Submitter | Matt Harbison |
---|---|
Date | Feb. 7, 2018, 4:58 a.m. |
Message ID | <7b2b82f891bf6355ed87.1517979506@Envy> |
Download | mbox | patch |
Permalink | /patch/27403/ |
State | Accepted |
Headers | show |
Comments
> On Feb 7, 2018, at 05:58, Matt Harbison <mharbison72@gmail.com> wrote: > > # HG changeset patch > # User Matt Harbison <matt_harbison@yahoo.com> > # Date 1517979217 18000 > # Tue Feb 06 23:53:37 2018 -0500 > # Branch stable > # Node ID 7b2b82f891bf6355ed87c06ed9198bfcd033fe7d > # Parent 1d60ad093792706e1dc7a52b20942593f2c19655 > fileset: don't abort when running copied() on a revision with a removed file queued, thanks
Patch
diff --git a/mercurial/fileset.py b/mercurial/fileset.py --- a/mercurial/fileset.py +++ b/mercurial/fileset.py @@ -464,9 +464,10 @@ getargs(x, 0, 0, _("copied takes no arguments")) s = [] for f in mctx.subset: - p = mctx.ctx[f].parents() - if p and p[0].path() != f: - s.append(f) + if f in mctx.ctx: + p = mctx.ctx[f].parents() + if p and p[0].path() != f: + s.append(f) return s @predicate('revs(revs, pattern)') diff --git a/tests/test-fileset.t b/tests/test-fileset.t --- a/tests/test-fileset.t +++ b/tests/test-fileset.t @@ -249,6 +249,8 @@ Test merge states $ hg ci -m manychanges + $ hg file -r . 'set:copied() & modified()' + [1] $ hg up -C 0 * files updated, 0 files merged, * files removed, 0 files unresolved (glob) $ echo c >> b2