Patchwork [4,of,6,V2] rebase: remove "if True"

login
register
mail settings
Submitter Jun Wu
Date July 8, 2017, 2:11 a.m.
Message ID <46beedf52f30bb4ff4a9.1499479887@x1c>
Download mbox | patch
Permalink /patch/22120/
State Accepted
Headers show

Comments

Jun Wu - July 8, 2017, 2:11 a.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1499479383 25200
#      Fri Jul 07 19:03:03 2017 -0700
# Node ID 46beedf52f30bb4ff4a9077c5b1868b45cddcbe6
# Parent  4058f9bd7f385f065a9e91f6443bd2c30f9e8424
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 46beedf52f30
rebase: remove "if True"

The "if True" block was to make the last patch easier to review. This patch
removes "if True" and unindents the block.

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1295,15 +1295,14 @@  def clearrebased(ui, repo, state, skippe
     tonode = repo.changelog.node
     mapping = {}
-    if True:
-        for rev, newrev in sorted(state.items()):
-            if newrev >= 0 and newrev != rev:
-                if rev in skipped:
-                    succs = ()
-                elif collapsedas is not None:
-                    succs = (collapsedas,)
-                else:
-                    succs = (tonode(newrev),)
-                mapping[tonode(rev)] = succs
-        scmutil.cleanupnodes(repo, mapping, 'rebase')
+    for rev, newrev in sorted(state.items()):
+        if newrev >= 0 and newrev != rev:
+            if rev in skipped:
+                succs = ()
+            elif collapsedas is not None:
+                succs = (collapsedas,)
+            else:
+                succs = (tonode(newrev),)
+            mapping[tonode(rev)] = succs
+    scmutil.cleanupnodes(repo, mapping, 'rebase')
 
 def pullrebase(orig, ui, repo, *args, **opts):