changeset 6534:9b35a9f34675

verify: check copy source revlog and nodeid
author Patrick Mezard <pmezard@gmail.com>
date Mon, 14 Apr 2008 22:31:33 +0200
parents 2b181fb3a70a
children 93e140dbcd44
files mercurial/verify.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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