subrepos

Jim Hewes jhewes at docucap.com
Tue May 18 19:13:48 UTC 2010


 
I don't have an answer, but I'm in a similar situation as you. I want to
share files across projects. I'm looking at how I might do this with
subrepos but haven't had the time to figure it out completely yet. I don't
mean to hijack your question but only to support it.
 
It seems to me that sharing code is a fundamental tenet of software
development, yet I'm not sure that version control systems take it into
consideration very well. Am I missing something? For example, in my company
we may develop our own C++ string class called SuperString. So it would be
only two files, SuperString.h and SuperString.cpp. Now we want to use that
in various other projects. But I don't want to have to copy those files
around and version them separately in each project. I may improve the
SuperString class in my ProjectA, but I don't want to have to manually copy
those improvements to ProjectB through ProjectK. There should only be one
place for SuperString class. When I make an improvement to the SuperString
class in ProjectA and push the ProjectA changes, I want that SuperString
improvement to be available to all other projects that include SuperString
if they should decide to update to that new revision. 
 
But it could be that the change I made to SuperString in ProjectA would
break something in ProjectB if ProjectB were to update to the latest
version. So ProjectB should be able to stick, or pin, to the old revision of
SuperString until it can be updated to accommodate the improvements without
breaking.
 
As you say, it seems kind of unwieldy that each class like this I want to
share needs it own repository. I may have many classes in my company that
can be shared if I'm building my own internal library. True, I might avoid
it by putting many classes together in one repository and including the
whole thing with every project. But then not only would I get a lot of files
cluttering up my working directory that aren't used in the project, but what
if I wanted to use different revisions of different classes? No way to do
that, except to go back to one-repository-per-class. Though, I realize the
changeset model being per-repository rather than per-file necessitates this.
(I don't know if I'm remembering correctly now, but I once used MS
SourceSafe back  in the 90's and I thought it handled sort of thing this
well.)
 
Sorry, I planned to do a better explanation later after I spent more time
with subrepos. But the subject came up.
 
Jim
 
 
From: mercurial-bounces at selenic.com [mailto:mercurial-bounces at selenic.com]
On Behalf Of Ken Halprin
Sent: Monday, May 17, 2010 7:17 PM
To: mercurial at selenic.com
Subject: subrepos
 
I'm just getting a handle on subrepos and have a basic question.  Is a
subrepo (or repo for that matter) always a directory/folder, or is there any
way to combine files of different repos into the same directory/folder?
 
I need to use subrepos to share common files across projects, but I think
I'll need quite a few (maybe 4 or 5) subrepos to capture everything. This
seems kind of messy for the build location. I'm used to having projects with
all or most files in one folder and maybe a few in a contained folder (or
maybe I've just had a simple life until now J).
 
Thanks,
Ken
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20100518/89ebd2a5/attachment.html>


More information about the Mercurial mailing list