changeset 1548:7f83be82d03f

revset: fix ordering issue of "svnrev()" This is subtle. See https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-August/103368.html for the context. Basically, `subset & x` (instead of `x & subset`) should be used to make order correct given the current revset API.
author Jun Wu <quark@fb.com>
date Tue, 19 Dec 2017 14:19:00 -0800
parents 910f56f0d09c
children 8410a978c650
files hgsubversion/util.py
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/util.py
+++ b/hgsubversion/util.py
@@ -373,14 +373,9 @@ def revset_svnrev(repo, subset, x):
     if not meta.revmapexists:
         raise hgutil.Abort("svn metadata is missing - "
                            "run 'hg svn rebuildmeta' to reconstruct it")
-    revs = []
-    for n in meta.revmap.revhashes(revnum):
-        r = repo[n].rev()
-        if r in subset:
-            revs.append(r)
-    if smartset is not None:
-        revs = smartset.baseset(revs)
-    return revs
+    torev = repo.changelog.rev
+    revs = revset.baseset(torev(r) for r in meta.revmap.revhashes(revnum))
+    return subset & revs
 
 revsets = {
     'fromsvn': revset_fromsvn,