changeset 17388:54feb8d3bab7

merge with stable
author Matt Mackall <mpm@selenic.com>
date Fri, 24 Aug 2012 14:53:07 -0500
parents 1fce478552b8 (current diff) 45b5eb2941d0 (diff)
children 74b44f25b4b1
files mercurial/commands.py
diffstat 3 files changed, 26 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Aug 24 14:52:45 2012 -0500
+++ b/mercurial/commands.py	Fri Aug 24 14:53:07 2012 -0500
@@ -4269,7 +4269,7 @@
                              hint=_("run 'hg heads .' to see heads"))
 
         parent = repo.dirstate.p1()
-        if len(nbhs) == 1:
+        if len(nbhs) <= 1:
             if len(bheads) > 1:
                 raise util.Abort(_("heads are bookmarked - "
                                    "please merge with an explicit rev"),
--- a/mercurial/verify.py	Fri Aug 24 14:52:45 2012 -0500
+++ b/mercurial/verify.py	Fri Aug 24 14:53:07 2012 -0500
@@ -120,6 +120,7 @@
     havemf = len(mf) > 0
 
     ui.status(_("checking changesets\n"))
+    hasmanifest = False
     seen = {}
     checklog(cl, "changelog", 0)
     total = len(repo)
@@ -130,16 +131,22 @@
 
         try:
             changes = cl.read(n)
-            mflinkrevs.setdefault(changes[0], []).append(i)
+            if changes[0] != nullid:
+                mflinkrevs.setdefault(changes[0], []).append(i)
+                hasmanifest = True
             for f in changes[3]:
                 filelinkrevs.setdefault(f, []).append(i)
         except Exception, inst:
+            hasmanifest = True
             exc(i, _("unpacking changeset %s") % short(n), inst)
     ui.progress(_('checking'), None)
 
     ui.status(_("checking manifests\n"))
     seen = {}
-    checklog(mf, "manifest", 0)
+    if hasmanifest:
+        # Do not check manifest if there are only changelog entries with
+        # null manifests.
+        checklog(mf, "manifest", 0)
     total = len(mf)
     for i in mf:
         ui.progress(_('checking'), i, total=total, unit=_('manifests'))
--- a/tests/test-verify.t	Fri Aug 24 14:52:45 2012 -0500
+++ b/tests/test-verify.t	Fri Aug 24 14:53:07 2012 -0500
@@ -61,10 +61,22 @@
   $ cd ../../..
   $ cd ..
 
-test revlog corruption
+test changelog without a manifest
 
   $ hg init b
   $ cd b
+  $ hg branch foo
+  marked working directory as branch foo
+  (branches are permanent and global, did you want a bookmark?)
+  $ hg ci -m branchfoo
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  0 files, 1 changesets, 0 total revisions
+
+test revlog corruption
 
   $ touch a
   $ hg add a
@@ -79,12 +91,12 @@
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-   a@0: broken revlog! (index data/a.i is corrupted)
+   a@1: broken revlog! (index data/a.i is corrupted)
   warning: orphan revlog 'data/a.i'
-  1 files, 1 changesets, 0 total revisions
+  1 files, 2 changesets, 0 total revisions
   1 warnings encountered!
   1 integrity errors encountered!
-  (first damaged changeset appears to be 0)
+  (first damaged changeset appears to be 1)
   [1]
 
   $ cd ..