Mercurial > public > mercurial-scm > hg-stable
diff hgext/largefiles/overrides.py @ 17108:1894dac619de
subrepo: propagate matcher to subrepos when archiving
Add a match object to subrepo.archive(). This will allow the -X and -I
options to be honored inside subrepos when archiving. They formerly
only affect the top level repo.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 16 Jun 2012 22:34:06 -0400 |
parents | dcac72c9efb2 |
children | 5884812686f7 |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py Mon Jun 18 22:45:21 2012 -0400 +++ b/hgext/largefiles/overrides.py Sat Jun 16 22:34:06 2012 -0400 @@ -807,17 +807,22 @@ if subrepos: for subpath in ctx.substate: sub = ctx.sub(subpath) - sub.archive(repo.ui, archiver, prefix) + submatch = match_.narrowmatcher(subpath, matchfn) + sub.archive(repo.ui, archiver, prefix, submatch) archiver.done() -def hgsubrepoarchive(orig, repo, ui, archiver, prefix): +def hgsubrepoarchive(orig, repo, ui, archiver, prefix, match=None): rev = repo._state[1] ctx = repo._repo[rev] lfcommands.cachelfiles(ui, repo._repo, ctx.node()) def write(name, mode, islink, getdata): + # At this point, the standin has been replaced with the largefile name, + # so the normal matcher works here without the lfutil variants. + if match and not match(f): + return data = getdata() archiver.addfile(prefix + repo._path + '/' + name, mode, islink, data) @@ -848,7 +853,9 @@ for subpath in ctx.substate: sub = ctx.sub(subpath) - sub.archive(ui, archiver, os.path.join(prefix, repo._path) + '/') + submatch = match_.narrowmatcher(subpath, match) + sub.archive(ui, archiver, os.path.join(prefix, repo._path) + '/', + submatch) # If a largefile is modified, the change is not reflected in its # standin until a commit. cmdutil.bailifchanged() raises an exception