RCF: archive for subrepositories

Matt Mackall mpm at selenic.com
Thu Jul 15 22:32:09 CDT 2010


On Wed, 2010-07-14 at 21:48 +0200, Martin Geisler wrote:
> Hi guys,
> 
> I've been working on adding support for subrepositories to 'hg archive'.
> After some refactoring which I just pushed to crew, these two patches
> remain.
> 
> Matt suggested on IRC that I add a revision argument to the new subrepo
> methods. I think that makes sense so that you can reuse the same subrepo
> instance for several things. I can add that in the next iteration.
> Having a revision would also make it possible to do
> 
>   wfiles = sub.files(None)
> 
> to get the working copy files, i.e., including files not commited. This
> should be useful for addign subrepo support to 'hg add'.
> 
> You'll notice that the second adds a test case without an output file,
> so this is just to give you something to test with.
> 
> Notice also that there is some overlap between abstractsubrepo.archive
> and archival.archive. We could get rid of this if we could turn the repo
> into a subrepo and just call archive on the subrepo. However, that would
> push all the archival logic into the subrepo class which is a bit weird.

At some level it would be nice to have contexts be able to deal with
this and then just have archive know about contexts. For instance:

for f in ctx[foo].files(subs=opts['sub']):
    data = ctx[foo][f].data()
    self.add(f, data)

Or something like that.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list