Patchwork [08,of,17] rebase: instead of using >= 0, use the slightly more meaningful > nullrev

login
register
mail settings
Submitter Mads Kiilerich
Date Nov. 30, 2014, 7:08 p.m.
Message ID <29e5055154d72cee5398.1417374515@localhost.localdomain>
Download mbox | patch
Permalink /patch/6912/
State Changes Requested
Headers show

Comments

Mads Kiilerich - Nov. 30, 2014, 7:08 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1417374421 -3600
#      Sun Nov 30 20:07:01 2014 +0100
# Node ID 29e5055154d72cee53986e57b50b6ee6a999bd88
# Parent  848717d552179b3679951aefc0b28235784471ba
rebase: instead of using >= 0, use the slightly more meaningful > nullrev

Avoid using a hardcoded number - use the defined constant.
Pierre-Yves David - Dec. 1, 2014, 7:17 a.m.
On 11/30/2014 11:08 AM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1417374421 -3600
> #      Sun Nov 30 20:07:01 2014 +0100
> # Node ID 29e5055154d72cee53986e57b50b6ee6a999bd88
> # Parent  848717d552179b3679951aefc0b28235784471ba
> rebase: instead of using >= 0, use the slightly more meaningful > nullrev

Meh, this kind of contradict you previous patch.

> Avoid using a hardcoded number - use the defined constant.

Moreover, >= 0 is not a random number. It state "number is positive". I 
woudl keep it as such.

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -961,7 +961,7 @@  def clearrebased(ui, repo, state, skippe
     if obsolete.isenabled(repo, obsolete.createmarkersopt):
         markers = []
         for rev, newrev in sorted(state.items()):
-            if newrev >= 0:
+            if newrev > nullrev:
                 if rev in skipped:
                     succs = ()
                 elif collapsedas is not None: