[?] SVN best practises

Making or wanting help making your own asset? Check in here
Post Reply
temexter
Posts: 397
Joined: 2009-11-23 15:50

[?] SVN best practises

Post by temexter »

IRT https://www.realitymod.com/forum/f388-p ... ost1460555.

Ty [R-DEV]J.F.Leusch69.

And couple of issues.

I've set up a SVN repository. First of all imported whole mod directory. It's quite convienient as all project members can just check it out and have a working local version. After modications to source they just put them back to appropriate zip and Commit.

But i see couple of disavantages:
  • SVN (as i understand) can not merge zip files. This can cause conflict in SVN when Mr. A Commits a zip and Mr.B has changed same zip locally and tries to make SVN Update. Of course Mr.A could lock the file, but i don't see it as a productive metdod.
  • Moving huge unzipped folders is quite time consuming (not all of us have 100/10Mbps like me).
As i see unified SVN repo structure (with community [factions]) quite essential and therefore i woul'd appreciate if J.F.Leusch69 or someone else could kindly enligten be a bit in this issue.

I think that at this stage proper SVN structure and procedures are crucial for the future.
Image
ImageImageImage
J.F.Leusch69
Retired PR Developer
Posts: 2988
Joined: 2008-04-23 16:37

Re: [?] SVN best practises

Post by J.F.Leusch69 »

SVN can merge zips, but we usually leave zips as folder with '-zip' suffix (except maps)

doing anything with huge amount of files in/with a SVN programm will take a lot of time, you can overcome this if you keep the files the SVN has to 'work with' to a minimum inside the repo, like you have change some tweaks files of handheld weapons, than you do not need to have the SVN programm checking the whole repo for the changed files, rather go to the weapons/handheld folder and just commit from there.
temexter
Posts: 397
Joined: 2009-11-23 15:50

Re: [?] SVN best practises

Post by temexter »

[R-DEV]J.F.Leusch69 wrote:SVN can merge zips,
Aaah. Nice. SVN documentation states can't commit binary files, but apparently zips are not binary in SVN's point of view :-)
[R-DEV]J.F.Leusch69 wrote:but we usually leave zips as folder with '-zip' suffix (except maps)
Hmm. Did i get get what you mean. Folders in which to zip's are unpacked are named "original folder name"-zip?

e.g.:
  • \objects\common_server.zip is unzipped to \objects\common_server folder
  • \objects\common_client.zip is unzipped to \objects\common_client folder
  • folders are renamed common_server-zip and common_client-zip
OR
  • both common_server.zip and common_client.zip are extracted to common folder (which was stated in some Editor tut, i recall)
  • folder is renamed common-zip
[R-DEV]J.F.Leusch69 wrote:doing anything with huge amount of files in/with a SVN programm will take a lot of time, you can overcome this if you keep the files the SVN has to 'work with' to a minimum inside the repo, like you have change some tweaks files of handheld weapons, than you do not need to have the SVN programm checking the whole repo for the changed files, rather go to the weapons/handheld folder and just commit from there.
I have understood that. For i have worked with version management formerly. I was just pondering some way to minimize need to update/commit folders with unpacked zip's as e.g weapon_client is 506 MB.

But above all: did i get it right in words of one syllable:
  • all zip files in objects folder are extracted and folders suffixed with -zip
  • whole \mods"pr_edit" folder is then imported to SVN as is
  • everyone makes checkout
  • files are edited in -zip folders "by hand", using bf2editor etc
  • edited files in -zip folders are updated into said zip
  • changes are commited
In this way (which is the state i am in) everyone will have a working local version and there is no need for someone (me) to make packages for running local for testing. Right?

Updates and commits will take either bandwidth or time and in case of time i see for a developer it is fruitful to have a little pause and time to think every now and then :)
Image
ImageImageImage
J.F.Leusch69
Retired PR Developer
Posts: 2988
Joined: 2008-04-23 16:37

Re: [?] SVN best practises

Post by J.F.Leusch69 »

all zip files in objects folder are extracted and folders suffixed with -zip (it can be useful to do that so you get the basic structur into the repo, but the content of vBF2 and PR is not needed in your repo, because you will load your repo, PR and vBF2; so you only need your new content in the repo plus some files from PR because you sometimes need to edit some files from PR so your new faction will work with it)

whole \mods\"pr_edit" folder is not imported to SVN as is

everyone makes checkout, yes its needed to get the repo files :D

files are edited in -zip folders "by hand", using bf2editor etc; yes, but do not trust the bf2editor when it comes to saving changes in codes, it will mostly change something it shouldnt change etc, so make sure you only commit changes you want to the repo

edited files in -zip folders are updated into said zip; we use scripts that build zips from the '-zip' folders but you can do that by hand without problems

changes are commited; as you like :)
temexter
Posts: 397
Joined: 2009-11-23 15:50

Re: [?] SVN best practises

Post by temexter »

Humble thanks [R-DEV]J.F.Leusch69 :-D
Image
ImageImageImage
Sniperdog
Retired PR Developer
Posts: 1177
Joined: 2009-02-27 00:06

Re: [?] SVN best practises

Post by Sniperdog »

There are also a few files you are going to want to put on ignore lists for certain directories, eg for the objects directory all the .zip files should be ignored so that you can set them up in a working directory (mymod_repo/objects) and make a script that compiles your *-zip folders into *.zip files. You can then run the built repo right out of mymod_repo.
Image

Image

Will Stahl aka "Merlin" in the Squad community
temexter
Posts: 397
Joined: 2009-11-23 15:50

Re: [?] SVN best practises

Post by temexter »

[R-DEV]Sniperdog wrote:There are also a few files you are going to want to put on ignore lists for certain directories, eg for the objects directory all the .zip files should be ignored so that you can set them up in a working directory (mymod_repo/objects) and make a script that compiles your *-zip folders into *.zip files. You can then run the built repo right out of mymod_repo.
Perfect. I was just going to ask that. In fact i am quite familiar with version control, but unaware of methods/procedure/tools pr community uses.

I'll create a new repo to Google Code and make a build of my "initial" version of faction (which is atm in my shell providers SVN) and then we we'll be ready rock :smoke:

But not until Sunday, because from tomorrow 09:57PRT til Sunday morning we'll be playing 24/7 as long as we stand :shock:

And my special thanks go to [R-DEV]Rhino and [R-DEV]Sniperdog for info about build scripts and USI Mod Compiler.
Image
ImageImageImage
temexter
Posts: 397
Joined: 2009-11-23 15:50

Re: [?] SVN best practises

Post by temexter »

Hmm. A bit confused.

I asked:
temexter wrote: e.g.:
  • \objects\common_server.zip is unzipped to \objects\common_server folder
  • \objects\common_client.zip is unzipped to \objects\common_client folder
  • folders are renamed common_server-zip and common_client-zip
OR
  • both common_server.zip and common_client.zip are extracted to common folder (which was stated in some BF2Editor tut)
  • folder is renamed common-zip
So is it the latter alternative?

So far i have extracted zips one by one as in first alternative way. And put them back by hand.
Last edited by temexter on 2010-10-25 03:41, edited 1 time in total.
Image
ImageImageImage
J.F.Leusch69
Retired PR Developer
Posts: 2988
Joined: 2008-04-23 16:37

Re: [?] SVN best practises

Post by J.F.Leusch69 »

easier to keep client and server files seperate.

(client contains all sounds, textures and meshes (except collmeshes))
(server contains all tweak's, con's and collmeshes)
temexter
Posts: 397
Joined: 2009-11-23 15:50

Re: [?] SVN best practises

Post by temexter »

[R-DEV]Sniperdog wrote:There are also a few files you are going to want to put on ignore lists for certain directories, eg for the objects directory all the .zip files should be ignored so that you can set them up in a working directory (mymod_repo/objects) and make a script that compiles your *-zip folders into *.zip files. You can then run the built repo right out of mymod_repo.
The original Rexman's scripts doesn't work for me. Discussed in this thread:https://www.realitymod.com/forum/f388-pr-bf2-community-modding/88665-modifying-pr_memeatlas.html
Last edited by temexter on 2010-10-18 15:15, edited 3 times in total.
Image
ImageImageImage
temexter
Posts: 397
Joined: 2009-11-23 15:50

Re: [?] SVN (and build) best practises

Post by temexter »

Okay. Back to business. Started to migrate factions initial build to 0.957.

I've edited Rexman's script so that it looks for <Object>-zip folders in "Objects" folder. At first puts existing zips to "OLD_Objects" folder just in case, creates zips to "Objects" folder and strips -zip from zip files names. So after running build script one can just launch pr.exe to test without further tuning.

I also made own scripts for all Objects (Common, Kits, Weapons etc) files so when making changes to eg one of them one must not pack all stuff in Objects folder :)

I unpacked zips to "Objects\<Object>-zip" folder as recommended. Tested and working. After first build with original files extracted new zip was different size though. Maybe you have added somethng to exclude lists or thre's some **** in zips?

I'll add .zip to SVN exclude list as instructed and we are almost happy with build procedure.

Even Pack_Menu works now for menu files, but looks like it does not handle PR_MemeAtlas* files at all.

So eg kit icons and flags might have to be put there "by hand" :/
Last edited by temexter on 2010-10-25 03:49, edited 1 time in total.
Image
ImageImageImage
temexter
Posts: 397
Joined: 2009-11-23 15:50

Re: [?] SVN best practises

Post by temexter »

Happy with modified build scripts now. Thanks for contributions.

Made also own .bat for faction_inits and will now make a Pack_ALL.bat to make build easier for others.

Pack_menu.bat need some McGyvering though. i suppose maybe it could somehow handle atlases :o
Last edited by temexter on 2010-11-09 21:34, edited 3 times in total.
Image
ImageImageImage
temexter
Posts: 397
Joined: 2009-11-23 15:50

Re: [?] SVN best practises

Post by temexter »

Any comments on this:
temexter wrote: That's obviously true. Sorry to disappoint you, but the serverarchives.con and clientarchives.con (as well as all pristine .957 files) are present in mods root.

They just are not in repository because they are not changed (against .957)

As i see it: it's handy to put only changed files to repo to make it easier to see the changes and to make repo "cleaner" and file count minimal. One's working dir needs anyway to be "initiated" with all .917 files (as well as unpacked objects for build scripts) for local and build procedures to work and as i see it's not wise to put them all in repo but instead only changed files (and of cource excluding unwanted files and filetypes).

If wiser people than me see that somehow unsound, pls feel free to contribute :)
Image
ImageImageImage
Post Reply

Return to “PR:BF2 Community Modding”