[PATCH remotenames] remotenames: be compatible with upstream change about smartset

Jun Wu quark at fb.com
Fri Feb 10 21:15:39 UTC 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1486761243 28800
#      Fri Feb 10 13:14:03 2017 -0800
# Node ID cefa2cc8e03941120286a1c8819dd7d5d62ae84b
# Parent  18f8e0f8ba54270bf158734c781327581cf43634
remotenames: be compatible with upstream change about smartset

The revset sets are moved to smartset.

diff --git a/remotenames.py b/remotenames.py
--- a/remotenames.py
+++ b/remotenames.py
@@ -45,4 +45,9 @@ from hgext import schemes
 from hgext.convert import hg as converthg
 
+try:
+    from mercurial import smartset
+except ImportError:
+    smartset = revset
+
 # namespace to use when recording an hg journal entry
 journalremotebookmarktype = 'remotebookmark'
@@ -1574,8 +1579,8 @@ def upstream_revs(filt, repo, subset, x)
 
     if not upstream_tips:
-        return revset.baseset([])
+        return smartset.baseset([])
 
     tipancestors = repo.revs('::%ln', upstream_tips)
-    return revset.filteredset(subset, lambda n: n in tipancestors)
+    return smartset.filteredset(subset, lambda n: n in tipancestors)
 
 def upstream(repo, subset, x):
@@ -1627,5 +1632,5 @@ def remotenamesrevset(repo, subset, x):
 
     results = (cl.rev(n) for n in remoterevs if n in repo)
-    return subset & revset.baseset(sorted(results))
+    return subset & smartset.baseset(sorted(results))
 
 revset.symbols.update({'upstream': upstream,


More information about the Mercurial-devel mailing list