Patchwork D2691: commands: don't check for merge.update() truthiness

login
register
mail settings
Submitter phabricator
Date March 5, 2018, 6:18 a.m.
Message ID <differential-rev-PHID-DREV-5rma3rttlyqpwpxbas2b-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29045/
State Superseded
Headers show

Comments

phabricator - March 5, 2018, 6:18 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  AFAICT ``stats`` is always a tuple in these cases. We don't
  need to check if the variable has a truthy value.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/rebase.py
  mercurial/commands.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel
phabricator - March 12, 2018, 9:54 p.m.
durin42 requested changes to this revision.
durin42 added a comment.
This revision now requires changes to proceed.


  Needs rebased, and the parent listed in the patch header isn't available for me. Can you give a rebase a shot?

REPOSITORY
  rHG Mercurial

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

To: indygreg, #hg-reviewers, durin42
Cc: durin42, mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2301,7 +2301,7 @@ 
             finally:
                 repo.ui.setconfig('ui', 'forcemerge', '', 'graft')
             # report any conflicts
-            if stats and stats[3] > 0:
+            if stats[3] > 0:
                 # write out state for --continue
                 nodelines = [repo[rev].hex() + "\n" for rev in revs[pos:]]
                 repo.vfs.write('graftstate', ''.join(nodelines))
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -490,7 +490,7 @@ 
                                      'rebase')
                         stats = rebasenode(repo, rev, p1, base, self.state,
                                            self.collapsef, dest, wctx=self.wctx)
-                        if stats and stats[3] > 0:
+                        if stats[3] > 0:
                             if self.wctx.isinmemory():
                                 raise error.InMemoryMergeConflictsError()
                             else: