Patchwork [3,of,3] graphmod: don't try to visit nullrev (issue3772)

login
register
mail settings
Submitter Sean Farley
Date Jan. 23, 2013, 6:28 a.m.
Message ID <2f6922395c30f3f3ef0b.1358922501@laptop.local>
Download mbox | patch
Permalink /patch/716/
State Superseded
Commit e441657b372bef3569b8bdaeeaa1597e55f684d2
Headers show

Comments

Sean Farley - Jan. 23, 2013, 6:28 a.m.
# HG changeset patch
# User Bryan O'Sullivan <bryano@fb.com>
# Date 1358922026 21600
# Branch stable
# Node ID 2f6922395c30f3f3ef0b4600f8ee2dc52c164fd6
# Parent  d45b0b049d80d06939ca7c7f33eed4ecdb619d62
graphmod: don't try to visit nullrev (issue3772)

Patch

diff --git a/mercurial/graphmod.py b/mercurial/graphmod.py
--- a/mercurial/graphmod.py
+++ b/mercurial/graphmod.py
@@ -179,11 +179,11 @@ 
             newparents.append(parent)
 
     ncols = len(seen)
     nextseen = seen[:]
     nextseen[nodeidx:nodeidx + 1] = newparents
-    edges = [(nodeidx, nextseen.index(p)) for p in knownparents]
+    edges = [(nodeidx, nextseen.index(p)) for p in knownparents if p != nullrev]
 
     while len(newparents) > 2:
         # ascii() only knows how to add or remove a single column between two
         # calls. Nodes with more than two parents break this constraint so we
         # introduce intermediate expansion lines to grow the active node list
diff --git a/tests/test-glog.t b/tests/test-glog.t
--- a/tests/test-glog.t
+++ b/tests/test-glog.t
@@ -2107,6 +2107,14 @@ 
   o
   |
   o
   
 
+issue3772
+
+  $ hg glog -r :null
+  o  changeset:   -1:000000000000
+     user:
+     date:        Thu Jan 01 00:00:00 1970 +0000
+  
+
   $ cd ..