Conceptual Question about Repos and structuring development workspaces...

Matt Mackall mpm at selenic.com
Tue Mar 20 15:44:50 UTC 2007


On Wed, Mar 21, 2007 at 12:55:04AM +1100, Sean wrote:
> Hi,
> 
> I am new to Mercurial and SCM in general.
> 
> I pored over the documentation and mailing list archives, and although
> I have picked up plenty of information on the technical aspects, I
> still find myself puzzling over the best way to actually use SCM in
> practice.
> 
> I have two general questions.
> 
> 1. How do I start using SCM with an existing codebase ?
> 
> Being new to SCM, my customer/project/ directories tend to be full of
> multiple copies of files.. ie:
> 
> index.php (latest)
> index1.php
> index2.php
> index3.php (oldest)
> 
> Ugly stuff, I know, but the question now is, do I do the following:
> 
> 1. ren index.php index_latest.php
> 2. ren index3.php index.php
> 3. hg add index.php
> 4. hg commit
> 5. del index.php
> etc etc
> 
> I will loose the relevance of the file dates (all commits will be
> today's date), but at least I will have captured the history of
> changes...

Oh my, that is ugly. You can use the -d option to put dates on
commits. See hg help dates for syntaxes.

> 2. At what level do I create repo's ?
> 
> Alot of my work is web and database. Web code tends to be interpreted,
> not compiled, hence not involving makefiles, etc  (This might be
> significant to the workspace structure as there is no real build
> process.)
> 
> I organise by customer, by project:
> 
> Do I create a single repo for each customer/project ?

Probably. For any two files, if you need to make syncronized changes
to them (aka an atomic commit that touches both), then they probably
belong in the same repository.

> Do the rules change for large collections of files i.e a large intranet ?
> Do I exclude binary files ?

You should include everything that isn't autogenerated.

> How should I break up the code / repos ?
> 
> I am a bit worried, that if I jump in making repos here, there and
> everywhere, I might come to regret it later.

You should probably just do one then until you're comfortable with how
it works.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial mailing list