changeset 353:8feb73f733cb

merge with stable fix
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 10 Jul 2012 16:14:29 +0200
parents 9c156b9caa4f (current diff) de3edd3856c3 (diff)
children 43f79983f638
files hgext/obsolete.py
diffstat 3 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Jul 10 15:14:58 2012 +0200
+++ b/.hgtags	Tue Jul 10 16:14:29 2012 +0200
@@ -2,3 +2,4 @@
 d3f20770b86a31dba56ae7b252089e12b34702da 0.2.0
 c046b083a5e0b21af69027f31cee141800cf894b 0.3.0
 9bbcd274689829d9239978236e16610688978233 0.4.0
+4ecbaec1d664b1e6f8ebc78292e1ced77a8e69c0 0.4.1
--- a/hgext/obsolete.py	Tue Jul 10 15:14:58 2012 +0200
+++ b/hgext/obsolete.py	Tue Jul 10 16:14:29 2012 +0200
@@ -566,7 +566,7 @@
                 del oldmark['id']  # dropped for now
                 del oldmark['reason']  # unused until then
                 oldobject = str(oldmark.pop('object'))
-                oldsubjects = [str(s) for s in oldmark.pop('subjects')]
+                oldsubjects = [str(s) for s in oldmark.pop('subjects', [])]
                 LOOKUP_ERRORS = (error.RepoLookupError, error.LookupError)
                 if len(oldobject) != 40:
                     try:
@@ -583,7 +583,9 @@
                 meta = dict((k.encode('utf-8'), v.encode('utf-8'))
                              for k, v in oldmark.iteritems())
                 try:
-                    store.create(bin(oldobject), [bin(n) for n in oldsubjects],
+                    succs = [bin(n) for n in oldsubjects]
+                    succs = [n for n in succs if n != nullid]
+                    store.create(bin(oldobject), succs,
                                  0, meta)
                     cnt += 1
                 except ValueError:
@@ -718,6 +720,7 @@
     while toproceed:
         current = toproceed.pop()
         assert len(current) <= 1, 'splitting not handled yet. %r' % current
+        current = [n for n in current if n != nullid]
         if current:
             n, = current
             if n in objectrels:
--- a/tests/test-oldconvert.t	Tue Jul 10 15:14:58 2012 +0200
+++ b/tests/test-oldconvert.t	Tue Jul 10 16:14:29 2012 +0200
@@ -78,9 +78,6 @@
   >     }, 
   >     {
   >         "reason": "import from older format.", 
-  >         "subjects": [
-  >             "a37154106de358121a32a3dd6ba0281931550515"
-  >         ], 
   >         "user": "Pierre-Yves David <pierre-yves.david@logilab.fr>", 
   >         "date": [
   >             1336557472.7875929, 
@@ -92,7 +89,7 @@
   >     {
   >         "reason": "import from older format.", 
   >         "subjects": [
-  >             "dc8d8aa6e8ac490fcafd074d570df0787ee0ee69"
+  >             "0000000000000000000000000000000000000000"
   >         ], 
   >         "user": "Pierre-Yves David <pierre-yves.david@logilab.fr>", 
   >         "date": [
@@ -111,7 +108,7 @@
   $ hg debugconvertobsolete --traceback
   3 obsolete marker converted
   $ hg debugsuccessors
-  2c3784e102bb dc8d8aa6e8ac
+  2c3784e102bb
   3e03d82708d4 3218406b50ed
-  5c722672795c a37154106de3
+  5c722672795c
   7c3bad9141dc d67cd0334eee