Patchwork [6,of,8] rebase: remove unecessary rebasestate file check in summary hook

login
register
mail settings
Submitter Christian Delahousse
Date Oct. 16, 2015, 2:33 a.m.
Message ID <e717eac5fb915f0d7c31.1444962815@dev4253.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11140/
State Changes Requested
Headers show

Comments

Christian Delahousse - Oct. 16, 2015, 2:33 a.m.
# HG changeset patch
# User Christian Delahousse <cdelahousse@fb.com>
# Date 1444949712 25200
#      Thu Oct 15 15:55:12 2015 -0700
# Node ID e717eac5fb915f0d7c31db9559dd866a57b0f0c0
# Parent  73fa24b0b32b6b65f3c3c71d066f54e149b69b87
rebase: remove unecessary rebasestate file check in summary hook

Since restorestatus returns None when no rebasestate file exists, there's no
need for a check in the summary hook. This fix just tests to see that what
restorestatus isn't Falsey

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1210,10 +1210,11 @@ 
     return obsoletenotrebased
 
 def summaryhook(ui, repo):
-    if not os.path.exists(repo.join('rebasestate')):
-        return
     try:
-        state = restorestatus(repo)[2]
+        result = restorestatus(repo)
+        if not result:
+            return
+        state = result[2]
     except error.RepoLookupError:
         # i18n: column positioning for "hg summary"
         msg = _('rebase: (use "hg rebase --abort" to clear broken state)\n')