revset: unindent "if True" block in sort() stable
authorYuya Nishihara <yuya@tcha.org>
Sat, 23 Apr 2016 16:11:05 +0900
branchstable
changeset 29002 ea794f2eb19d
parent 29001 923fa9e06ea0
child 29003 c6b108555dfa
revset: unindent "if True" block in sort() It was there to make the previous patch readable.
mercurial/revset.py
--- a/mercurial/revset.py	Sat Apr 23 16:09:30 2016 +0900
+++ b/mercurial/revset.py	Sat Apr 23 16:11:05 2016 +0900
@@ -1868,30 +1868,29 @@
         return revs
     # sort() is guaranteed to be stable
     ctxs = [repo[r] for r in revs]
-    if True:
-        for k in reversed(keys):
-            if k == 'rev':
-                ctxs.sort(key=lambda c: c.rev())
-            elif k == '-rev':
-                ctxs.sort(key=lambda c: c.rev(), reverse=True)
-            elif k == 'branch':
-                ctxs.sort(key=lambda c: c.branch())
-            elif k == '-branch':
-                ctxs.sort(key=lambda c: c.branch(), reverse=True)
-            elif k == 'desc':
-                ctxs.sort(key=lambda c: c.description())
-            elif k == '-desc':
-                ctxs.sort(key=lambda c: c.description(), reverse=True)
-            elif k in 'user author':
-                ctxs.sort(key=lambda c: c.user())
-            elif k in '-user -author':
-                ctxs.sort(key=lambda c: c.user(), reverse=True)
-            elif k == 'date':
-                ctxs.sort(key=lambda c: c.date()[0])
-            elif k == '-date':
-                ctxs.sort(key=lambda c: c.date()[0], reverse=True)
-            else:
-                raise error.ParseError(_("unknown sort key %r") % k)
+    for k in reversed(keys):
+        if k == 'rev':
+            ctxs.sort(key=lambda c: c.rev())
+        elif k == '-rev':
+            ctxs.sort(key=lambda c: c.rev(), reverse=True)
+        elif k == 'branch':
+            ctxs.sort(key=lambda c: c.branch())
+        elif k == '-branch':
+            ctxs.sort(key=lambda c: c.branch(), reverse=True)
+        elif k == 'desc':
+            ctxs.sort(key=lambda c: c.description())
+        elif k == '-desc':
+            ctxs.sort(key=lambda c: c.description(), reverse=True)
+        elif k in 'user author':
+            ctxs.sort(key=lambda c: c.user())
+        elif k in '-user -author':
+            ctxs.sort(key=lambda c: c.user(), reverse=True)
+        elif k == 'date':
+            ctxs.sort(key=lambda c: c.date()[0])
+        elif k == '-date':
+            ctxs.sort(key=lambda c: c.date()[0], reverse=True)
+        else:
+            raise error.ParseError(_("unknown sort key %r") % k)
     return baseset([c.rev() for c in ctxs])
 
 @predicate('subrepo([pattern])')