PDA

View Full Version : Code management


JHN
10-25-2007, 04:00 PM
I wanted to start a thread about code management. I have been using turtoise SVN for a while now to manage my scripts, I wonder how people organize their stuff...
I did it with versionnumbers before like:
myscript_01.ms
myscript_02.ms

But that got out of hand quickly, and I had files at home on my USB stick and at work... nightmare.

Now I make a repository for each new script/project, anyone else does that too, or just 1 big repository with all scripts?

Also, in max2008 the editor is setup to work with svn, anybody else got it to work? I tried implementing turtoise as the versioncontrol, but cannot get "add file" to work. Update does work though. Anyone else tried it?

-Johan

PEN
10-26-2007, 12:15 PM
I have been looking at winCVS and might impliment it soon so if there is something that will work with 2008 natively I will use that instead.

I use one large repository for all the scripts but I break that down into the seperate projects. So I guess my answer to your question is yes, I do both.

focomoso
10-26-2007, 05:52 PM
I've used cvs in a couple of work environments and as far as i can tell, it's a pain in the butt to set up and maintain. We were always having problems with it. This was with multiple clients working on multiple code bases simultaneously so it might be easier if it's in a smaller setting.

JHN
10-26-2007, 06:44 PM
As I said I used turtoise SVN a windows interface to subversion. I really like it, have to say I'm the only mxs guy in our shop, but it does everything I want, especcially dif is a tool I really like to compare versions.

I'm maybe thinking about setting 1 big repository for my scripts aswell, but I can't stand the idea that many scripts are raised a version when nothing has changed. But keeping a lot of projects is also not very desireable...

And by default the mxs editor seems to support perforce, but it's really all about commandline interface with your cvs... the link is commented out in the general settings file though.

-Johan

Gibbz
10-31-2007, 07:54 AM
tortise svn works well for me, just keep each script seperate and save over the top and it keeps a history etc for you :)

JHN
10-31-2007, 09:16 AM
tortise svn works well for me, just keep each script seperate and save over the top and it keeps a history etc for you :)

Do you use multiple repositories? Or 1 big one wih all the scripts?
Have you managed to get it integrated in the new 2008 script editor?

I really dig tortoise, using it for all my coding projects, php/mxs etc.

-Johan

Gibbz
11-04-2007, 11:22 PM
At work we use 1 big repository, same at home for me too.
However at home I store my scripts in individual folders to keep it more arranged.

I havent used max 2008 yet much. Can it be linked into SVN or does it use its own variation of SVN?

JHN
11-05-2007, 09:15 AM
Thanks for sharing... going to one repository too, easier to maintain.

Yeah, the SVN is used as example commandline parameters in the config file.

-Johan

Kramsurfer
11-29-2007, 12:44 AM
I wrote a simple verisoning system that uses a simple share point on the server.

Each .ms has a version variable in it that can be read and incremented on publish. Publishing is not allowed without 15 characters of notes... ha ha.. I have to force myself to make these notes :-)

When publishing it:
Adds the version note to top of the .ms
Uploads to the users share point to be downloaded to the users each time max starts.
Stores the verison in a per script folder with the version in the filename.
Adds Notes, Date and User to a Per Script log in the same folder.

Simple and Ugly, but it works with 1.5 Scripter's here...

Keith Morrison

Attached is an image of the UI..

davestewart
05-10-2008, 12:57 PM
Hey Johan,

I've had Tortoise on my hard drive for a while now, I just don't know how to use it, and finding help on the web has been non-eventful.

Can you give any pointers on how to get started!?

Thanks,
Dave

JHN
05-10-2008, 10:11 PM
Hi Dave,

Sure... once you get used to it it's really simple and conviniend.

Turtoise is a subversion spinoff integrated into the windows shell. So it's only meant to be accessed by the shell.

I think you're somewhat familiar with the concept, it uses a repository to store all the data, (this can/could be accessed by many people) and a working copy, where you edit your stuff in. If you think you've done enough coding you commit your changes back to the repository. If someone else had also put up stuff to the repository you'll need to update your working copy first before committing. If there's a conflict you will be notified and a comparison is made too see which changes to keep. With every commit you'll increase the revision of the project. You can always go back to older versions of your scripts. Which is very very handy, especially when you deleted portions of code that you thought weren't relevant anymore, but later on are relevant again. This also helps keeping your code clean and not worrying about loss of code you worked hard on.

Practical stuff:

Repository:
I have a repository c:\SVN folder on my harddrive where in each subfolder I create a repository. Say I have a project named "hairtools".
create C:\SVN\hairtools\ -> RMB : create repository.
depending on which version choose something like "native file format" or "file system" can't remember exactly, for the storage type... the latest version seems not to do this anymore.
This is your database, you'll won't find the files here since they're stored in a database.

Working copy:
Now you'll have to make a local folder anyplace and hit "svn checkout". This will get all the data from the repository. But since it's empty it will create a .svn folder which holds meta data. It will ask for the URL of the repository, which is in my case the C:\SVN\hairtools\
Hit ok. Now I can start working. Add files directories etc. Once I think I'm due to make a contribution to the repository I hit "SVN Commit" (RMB on the root folder of your working copy) and it will popup a dialog showing what's unversioned etc. Add all or just the files you want.

Export:
You can export your working copy to another location cleaning up all .svn folders. That's what you do if you want to publish your script online or to some else.

There's lot's more options but you'll find out their uses once your busy using tortoise.

Also, some people use 1 repository for all script and some like me use a repository per project. There's something to say for both. I have this nag that I think a svn version of a script should be for that script alone not for all scripts in the repository. But that's just this weird control thing I have. Cause one big repository is also quit easy to maintain...

Hope this gets you a head start!
Let us know your findings

Cheers,
-Johan

RustyKnight
05-11-2008, 11:58 PM
Hi all!

I use a single SVN reposiory for everything (max script, java code, c code, tools and libraries) and I've found it miles ahead of CVS (which it's suppose to be seen as it's the replacement...:P)

It's great because I can login to the VPN at work and do work on the go...so if I get that cracker of an idea at home, I can test it against real working code...great time saver...

I'd like to pull together a solution for the studio where the artiests can also use it, but I don't really have the time to develope one up...yet...(it would need to compliment the open and save functionality in some way, because I'd really like not to confuse them)

One of the biggest complaints I've had with CVS in the past is the inability to lock files (I think it can be done in later versions, but we had huge problems with it when I was first using it...). While I've not used it, I'm pretty sure that SVN provides this feature, great for stopping people from editing a file you're behind you back :{ ... Particularly binary files...

Shane.

RobGalanakis
05-12-2008, 12:20 AM
I'd like to pull together a solution for the studio where the artiests can also use it, but I don't really have the time to develope one up...yet...(it would need to compliment the open and save functionality in some way, because I'd really like not to confuse them)

You can register a pre-save callback to check out the current or target file from SVN using ShellLaunch or DOSCommand? The artist could have a checkbutton on his toolbar whether he is in checkout mode or something (turning it off would unregister the callback).

RustyKnight
05-12-2008, 01:51 AM
I was thinking about adding new menu items and adding the functionaility under that, but the it's all the same in the end...all I need now is time :P

Shane

davestewart
05-12-2008, 12:57 PM
Hey Johan,
WOW! Thanks so much for that detailed explanation, I'm sure that will give me a great head start. No doubt I'll be back with questions, but for teh meantime, that's perfect.
Cheers,
Dave

davestewart
05-16-2008, 03:26 PM
Hi again Johan (or any other SVN users!),

OK - I'm getting it. Still options that look dangerous like "patch this" and "branch that", but I get the basics of


how to create a new repository
dropping your files in there
updating / committing those files to the repository
getting different versions from the repository
So that's good.

Now I'm free to look at how I manage everything, with one big repository, or as you say, repositories per project. I have a LOT of development folders - so I guess it would be best to get them all in there.


So, justo be clear, here's my MaxScript folder on my Development drive:

http://forums.cgsociety.org/attachment.php?attachmentid=128131&stc=1

So I'm wondering at which level should I create repositories? I know it's a personal choice, but does one big repository eat up more room, or does it only store changes?
And does having loads of repositories become unmanageable?

Cheers,
Dave

JHN
05-17-2008, 02:52 PM
Hi again Johan (or any other SVN users!),

OK - I'm getting it. Still options that look dangerous like "patch this" and "branch that", but I get the basics of



how to create a new repository
dropping your files in there
updating / committing those files to the repository
getting different versions from the repository
So that's good.

Now I'm free to look at how I manage everything, with one big repository, or as you say, repositories per project. I have a LOT of development folders - so I guess it would be best to get them all in there.


So, justo be clear, here's my MaxScript folder on my Development drive:

http://forums.cgsociety.org/attachment.php?attachmentid=128131&stc=1

So I'm wondering at which level should I create repositories? I know it's a personal choice, but does one big repository eat up more room, or does it only store changes?
And does having loads of repositories become unmanageable?

Cheers,
Dave



Hi Dave,

Glad your getting the hang of it! I have to admit that I never branch or path anything, just create new ones, or export them and update and checkout files. Sometimes I get back to get an old version of a file and use the compare tool (very handy!).
My biggest ussue is a personal one... when do you commit to the repository. Do you want to use it as a backup tool, or a project tool with versions that make sense, not just commiting at the end of the day. So this is my issue with using 1 big repository, the version relates to nothing concrete. While in project I take care on what to commit when.
Cause 1 big repository will always +1 all files in it to each commit action. But then again maybe I'm just being neurotic....

The coolest thing about SVN is that you can use it over the network easy (though very slow over VPN :().. I use it alot with websites or scripts.. and I can always update to the latest version of anything from home or the other way around.

As you guessed it's really a personal choice... I don't have a problem managing multiple repositories, they are all found in c:\SVN\"repname1|repname2|etc"

I would not make a repository that holds your scripts and your websites, actionscript or whatever...

-Johan

CGTalk Moderation
05-17-2008, 02:52 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.