Starting to use source control
-
So I have an opportunity to start using source control here. I am thinking of using Mercurial over git. What I'm wondering is I have a situation where I have a small codebase consisting of fewer than 20 files, and I have 3 directories with three versions of those files. can I do something like create a repository, check them in[1], then overwrite the files in my working copy with the second version, check THOSE in, and then do the step a third time, to create a history? (Actually the first two versions have 12 files and the third has 4 new ones.)
[1] I know i'm not really using the right terminology in this post.
-
You could do that for a history, but for separate versions you may want to create release branches.
-
You could do that for a history, but for separate versions you may want to create release branches.
When I said versions I meant revisions, really. The files were created and put in ~/project. Then he updated them, and copied the updated files into ~/project/mods. Then he updated them again, added 4 new files, and copied all 16 into ~/project/mods2. I don't want to fuck around with that, but I want to keep the history.
So my thought was to follow the "create a project and commit" simple example on the Mercurial homepage, with the original version in ~/project. Then I'd overwrite the source files in the project directory with the versions in ~/project/mods, commit, overwrite again from ~/project/mods2, commit again, and then start some changes Ineed to make today.
-
That sounds reasonable to me.
-
Sounds about right to me to get him off of ZFSC -- Hg's a good choice for newbs, too. Nearly as powerful as git (and much more so than say SVN), and much easier to learn and better documented, too.
-
Excellent.
I would like to do more of this as time goes by, that is, uplifting existing projects into new repos.
-
Sounds about right to me to get him off of ZFSC -- Hg's a good choice for newbs, too. Nearly as powerful as git (and much more so than say SVN), and much easier to learn and better documented, too
A couple years ago I looked at git and hg, and read Spolky's tutorial on the latter, and thought it looked nicer to use.
-
-
Zip File Source Control
-
I am thinking of using Mercurial over git
I think you're making an excellent choice.
As others said, I see nothing wrong with your strategy. When you edit and save a file in an editor, you're doing effectively the same thing as what you plan to do.
-
I see. But what the person in question used was even worse - since it didn't even compress.
-
Hm?
YMBNH -- it's Zip File Source Control, i.e. project.zip, project_old.zip, project_2.0.zip, project_2.0_really.zip, etc
-
Like @Jaloopa in the night...
-
http://ericsink.com/vcbe/
Fairly Nice overwiew.
-
Glee! I'm adding one line of code to each of 16 files, and deleting a shitload of dead code!
I love source control.
(Before anyone asks, I'm familiar with it, having used it at other places, but we don't use it here. Until today.)
ETA: by "it" I mean source control in general, not hg.
-
Ok, I did this, aftger cloning the repo to my PC and making changes to my local copy and committing them:
[code]C:\work\xxx\source>hg push
pushing to s:\custom\xxx\source
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 16 changes to 16 files[/code]When I look in s:\custom\xxx\source, I still see the old versions of the files. Just to see what would happen, I cloned to a new directory on my PC and got my changes, so it looks like the push worked.
How do I make sure that what's in c:\custom\xxx\source represents the most recent commit?
-
> hg update
Or just
hg up
for short. The commands are very similar to svn, if that helps.
-
Ok, for the moment I have only got hg installed on my pc, and not the server. so I build the repo on the server's drive, but from my PC, if you know what I mean. I also made the local clone on my pc, so every time I've run hg so far it's executed on my CPU. I will install hg on the server today. But before I run that update, will it be safe to do it from my pc, as long as I'm in the s:...\ directory?
-
Did that and it worked. Then I moved the old copies of the source into an "attic" directory so they're out of the way.
Going forward I will convert other existing projects.
-
"attic" is for wimps, real men use
hg remove
-
Is it a "Choose your own adventure"book?
Bookmarked for later perusal.
-
-
"attic" is for wimps, real men use hg remove
You are expecting hg to delete files that aren't in the repo?
I kept the original versions, just tucked away somewhere.
-
But before I run that update, will it be safe to do it from my pc, as long as I'm in the s:...\ directory?
You can clone local repos and experiment with them very easily. Of course, the default for push will be over to the local repo you cloned from. You could also just copy the directory.
-
Zip File Source Control
I read ZFSC as "Zero Fucking Source Control", as in no source control.
I curse. A lot.
-
Well, they weren't using zip files, except as a delivery mechanism.
-
Reading posts is a to cheap jokes.
But you mostly triggered my repressed memories of CVS and SharePoint's half-baked version control where attic is also frequently used.
Taking backups like in your case is a good thing though.
-
Taking backups like in your case is a good thing though.
That directory's already got a twice-daily backup, fortunately.
-
http://ericsink.com/vcbe/
There are many software developers who strongly prefer not to use a command-line interface [with CVS in general]. Most of them stopped reading this book several chapters ago.
I LOL'd.
-
So, there's more of him? I'm scared.