D3137: histedit: simplify desthistedit

lothiraldan (Boris Feld) phabricator at mercurial-scm.org
Thu Apr 5 16:23:15 UTC 2018


lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Instead of sorting the revset and take the first one, take the minimum
  revision.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3137

AFFECTED FILES
  mercurial/destutil.py

CHANGE DETAILS

diff --git a/mercurial/destutil.py b/mercurial/destutil.py
--- a/mercurial/destutil.py
+++ b/mercurial/destutil.py
@@ -350,10 +350,8 @@
         revs = scmutil.revrange(repo, [default])
 
     if revs:
-        # The revset supplied by the user may not be in ascending order nor
-        # take the first revision. So do this manually.
-        revs.sort()
-        return revs.first()
+        # Take the first revision of the revset as the root
+        return revs.min()
 
     return None
 



To: lothiraldan, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list