Submitter | Matt Harbison |
---|---|
Date | Oct. 22, 2018, 2:50 a.m. |
Message ID | <53298a833905d63ff8bd.1540176614@Envy> |
Download | mbox | patch |
Permalink | /patch/36214/ |
State | Accepted |
Headers | show |
Comments
On Sun, 21 Oct 2018 22:50:14 -0400, Matt Harbison wrote: > # HG changeset patch > # User Matt Harbison <matt_harbison@yahoo.com> > # Date 1540175160 14400 > # Sun Oct 21 22:26:00 2018 -0400 > # Node ID 53298a833905d63ff8bde47bb175ddff534d5832 > # Parent cc4586749c8c99885619eaaa17e3157176c4523c > lfs: consult the narrow matcher when extracting pointers from ctx (issue5794) Queued, thanks. > --- a/hgext/lfs/wrapper.py > +++ b/hgext/lfs/wrapper.py > @@ -16,6 +16,7 @@ from mercurial import ( > error, > repository, > revlog, > + scmutil, Removed unused import.
Patch
diff --git a/hgext/lfs/wrapper.py b/hgext/lfs/wrapper.py --- a/hgext/lfs/wrapper.py +++ b/hgext/lfs/wrapper.py @@ -16,6 +16,7 @@ from mercurial import ( error, repository, revlog, + scmutil, util, ) @@ -374,7 +375,12 @@ def pointersfromctx(ctx, removed=False): stored for the path is an empty dict. """ result = {} + m = ctx.repo().narrowmatch() + + # TODO: consider manifest.fastread() instead for f in ctx.files(): + if not m(f): + continue p = pointerfromctx(ctx, f, removed=removed) if p is not None: result[f] = p diff --git a/tests/test-narrow-strip.t b/tests/test-narrow-strip.t --- a/tests/test-narrow-strip.t +++ b/tests/test-narrow-strip.t @@ -1,4 +1,12 @@ #testcases flat tree +#testcases lfs-on lfs-off + +#if lfs-on + $ cat >> $HGRCPATH <<EOF + > [extensions] + > lfs = + > EOF +#endif $ . "$TESTDIR/narrow-library.sh" diff --git a/tests/test-narrow.t b/tests/test-narrow.t --- a/tests/test-narrow.t +++ b/tests/test-narrow.t @@ -1,4 +1,12 @@ #testcases flat tree +#testcases lfs-on lfs-off + +#if lfs-on + $ cat >> $HGRCPATH <<EOF + > [extensions] + > lfs = + > EOF +#endif $ . "$TESTDIR/narrow-library.sh"