histedit: simplify desthistedit
authorBoris Feld <boris.feld@octobus.net>
Thu, 05 Apr 2018 18:02:42 +0200
changeset 37390 b95992605ef1
parent 37389 bef863a09acd
child 37391 3198d5a2514e
histedit: simplify desthistedit Instead of sorting the revset and take the first one, take the minimum revision. Differential Revision: https://phab.mercurial-scm.org/D3137
mercurial/destutil.py
--- a/mercurial/destutil.py	Thu Apr 05 17:58:58 2018 +0200
+++ b/mercurial/destutil.py	Thu Apr 05 18:02:42 2018 +0200
@@ -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