[PATCH 2 of 5] largefiles: fix the directory structure when archiving a subrepo in a subrepo

Matt Harbison matt_harbison at yahoo.com
Thu Jun 21 07:45:58 CDT 2012


Na'Tosha Bard wrote:
> 2012/6/20 Matt Harbison <matt_harbison at yahoo.com
> <mailto:matt_harbison at yahoo.com>>
>
>     # HG changeset patch
>     # User Matt Harbison <matt_harbison at yahoo.com
>     <mailto:matt_harbison at yahoo.com>>
>     # Date 1340074971 14400
>     # Node ID 0588cf50d6e8b4c06d4263418ef3b1dcc87a2bf8
>     # Parent  6f8473232a828efca13bac418e407e505801f55b
>     largefiles: fix the directory structure when archiving a subrepo in
>     a subrepo
>
>     Previously, a repo consisting of main/sub/subsub archived sub and
>     subsub as
>     siblings under main.
>
>     diff --git a/hgext/largefiles/overrides.py
>     b/hgext/largefiles/overrides.py
>     --- a/hgext/largefiles/overrides.py
>     +++ b/hgext/largefiles/overrides.py
>     @@ -850,7 +850,7 @@
>
>          for subpath in ctx.substate:
>              sub = ctx.sub(subpath)
>     -        sub.archive(ui, archiver, prefix)
>     +        sub.archive(ui, archiver, os.path.join(prefix, repo._path)
>     + '/')
>
> Seems OK -- ideally we wouldn't just be calling ._path right off of repo
> like that, but seems like it would require a bit of a refactor to make
> it more pretty.
>
> Na'Tosha
>

FWIW, the hgsubrepo.archive code does this too:

             s.archive(ui, archiver, os.path.join(prefix, self._path))

which is where I got it from.  The thing that bothered me was it doesn't 
require adding a trailing '/', whereas the patch above does.  I figured 
it was some difference in how _path was built, and didn't dig into why.

--Matt


More information about the Mercurial-devel mailing list