[PATCH 5 of 5] subrepo: propagate matcher to subrepos when archiving
Matt Harbison
matt_harbison at yahoo.com
Wed Jun 20 08:11:56 CDT 2012
Patrick Mézard <patrick <at> mezard.eu> writes:
>
> Le 20/06/12 06:45, Matt Harbison a écrit :
> > # HG changeset patch
> > # User Matt Harbison <matt_harbison <at> yahoo.com>
> > # Date 1339901591 14400
> > # Node ID eacce55ea7903d33760f761d01bbba492697657f
> > # Parent 8d07024897537dc44357830c4c57f13160c629e1
> > subrepo: propagate matcher to subrepos when archiving
> >
> > The archiving process for subrepos now properly considers -X and -I options.
> >
> > diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
> > if subrepos:
> > for subpath in ctx.substate:
> > sub = ctx.sub(subpath)
> > - sub.archive(repo.ui, archiver, prefix)
> > + submatch = matchmod.narrowmatcher(subpath, matchfn)
> > + sub.archive(repo.ui, archiver, prefix, submatch)
>
> Passing matchfn to narrowmatcher requires it to be a match object. This
> should not be a problem, at least in
> hg codebase, but you should adjust the function docstring saying:
> """
> matchfn is function to filter names of files to write to archive.
> """
> to explicitely mention it.
>
Can you explain a bit more? I was (pleasantly) surprised it worked. But I
didn't change the input to archival.archive()- it is still taking in the same
matching function. Do you mean add something like "This function must be
compatible with narrowmatcher."?
Thanks for the feedback. I'll wait a day or two to see if other comments come
in and/or to see if the first three patches get picked up before resubmitting.
--Matt
More information about the Mercurial-devel
mailing list