mercurial/commands.py
changeset 22305 bdc0e04df243
parent 22277 e116abad3afa
parent 22302 9472284df4eb
child 22310 aabf367306d5
--- a/mercurial/commands.py	Sat Aug 23 21:23:02 2014 +0900
+++ b/mercurial/commands.py	Wed Aug 27 18:35:34 2014 +0200
@@ -3221,14 +3221,23 @@
             ctx = repo[rev]
             n = ctx.extra().get('source')
             if n in ids:
-                r = repo[n].rev()
+                try:
+                    r = repo[n].rev()
+                except error.RepoLookupError:
+                    r = None
                 if r in revs:
                     ui.warn(_('skipping revision %s (already grafted to %s)\n')
                             % (r, rev))
                     revs.remove(r)
                 elif ids[n] in revs:
-                    ui.warn(_('skipping already grafted revision %s '
-                                '(%s also has origin %d)\n') % (ids[n], rev, r))
+                    if r is None:
+                        ui.warn(_('skipping already grafted revision %s '
+                                  '(%s also has unknown origin %s)\n')
+                                % (ids[n], rev, n))
+                    else:
+                        ui.warn(_('skipping already grafted revision %s '
+                                  '(%s also has origin %d)\n')
+                                % (ids[n], rev, r))
                     revs.remove(ids[n])
             elif ctx.hex() in ids:
                 r = ids[ctx.hex()]