verify: check copy source revlog and nodeid
authorPatrick Mezard <pmezard@gmail.com>
Mon, 14 Apr 2008 22:31:33 +0200
changeset 6534 9b35a9f34675
parent 6522 2b181fb3a70a
child 6535 93e140dbcd44
verify: check copy source revlog and nodeid
mercurial/verify.py
--- a/mercurial/verify.py	Fri Apr 04 02:21:53 2008 +0300
+++ b/mercurial/verify.py	Mon Apr 14 22:31:33 2008 +0200
@@ -245,7 +245,14 @@
                 rp = fl.renamed(n)
                 if rp:
                     fl2 = repo.file(rp[0])
-                    rev = fl2.rev(rp[1])
+                    if fl2.count() == 0:
+                        err(flr, _("empty or missing copy source revlog %s:%s")
+                            % (rp[0], short(rp[1])), f)
+                    elif rp[1] == nullid:
+                        err(flr, _("copy source revision is nullid %s:%s")
+                            % (rp[0], short(rp[1])), f)
+                    else:
+                        rev = fl2.rev(rp[1])
             except KeyboardInterrupt:
                 repo.ui.warn(_("interrupted"))
                 raise