Suffering from CVS mindset

Yawar Amin yawar.amin at gmail.com
Sat Apr 10 22:34:39 CDT 2010


On 4/10/10 11:00 PM, Harry Putnam said:
> [...]
> First off, I'm no kind of expert with cvs either, I've just used it
> for along time.  Very light homeboy usage only.
>
> If I were doing my experimental scripting and other projects and
> keeping version with cvs I'd do what I said above, beginning with
>  `I had visions...'
>   

$ pwd
/home/yawar/code
$ hg init myprojects # Creates the myprojects directory with a
repository inside
$ cd myprojects

> I'd work a few days inside the checked out module which would be what
> I described earlier, a series of top directories like shell, perl,
> backups, etc. possibly with files and subdirectories.
>   

$ mkdir shell perl backups
$ # ... (hack away inside the shell, perl, backups directories)

> after a few days, I'd run:
>
>   cvs -n update 2>/dev/null
>   

$ hg st # `st' is short for status

> Which would show me all the tracked files that had changed, plus any
> new files created.  I could then  commit what I wanted and go on about my
>   

$ cd shell
$ hg ci mycoolscript.sh # `ci' is short for commit
... editor starts up, edit the commit message and go ahead with the
commit ...
$ cd ..
$ hg ci perl/awesome.pl
... editor starts up, edit the commit message and go ahead with the
commit ...

> business.  No need to make a cvs repo of each directory or project as
> was suggested.
>   

There's absolutely no need to make a dozen little repositories for a
dozen little projects. Mercurial can handle your use case just fine.
It's just that some people like having separate histories for separate
projects. But even that can be simulated by having named branches which
are never merged and viewing the log for one branch at a time:

$ hg log -b shell |less
$ hg log -b perl |less
$ hg log -b backups |less

However, if you use named branches that never merge, then at any one
time only the files from a single branch (shell, perl or backups) will
be visible inside the working directory; the others will be packed away
inside the repo and you'll have to do `hg up branchname' to bring out
the files from another branch.

If the last couple of paragraphs make no sense, just ignore them for now
and let yourself learn the Mercurial branching concepts at your own pace.

HTH,

 Yawar


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://selenic.com/pipermail/mercurial/attachments/20100410/d59642f4/attachment.pgp>


More information about the Mercurial mailing list