mercurial/commands.py
changeset 18039 2c2564280900
parent 18038 f8aee8033ab2
child 18053 0c2f0048125d
--- a/mercurial/commands.py	Tue Dec 04 12:54:18 2012 -0800
+++ b/mercurial/commands.py	Tue Dec 04 12:54:18 2012 -0800
@@ -2830,8 +2830,8 @@
 
     wlock = repo.wlock()
     try:
+        current = repo['.']
         for pos, ctx in enumerate(repo.set("%ld", revs)):
-            current = repo['.']
 
             ui.status(_('grafting revision %s\n') % ctx.rev())
             if opts.get('dry_run'):
@@ -2883,6 +2883,8 @@
                         date=date, extra=extra, editor=editor)
             if node is None:
                 ui.status(_('graft for revision %s is empty\n') % ctx.rev())
+            else:
+                current = repo[node]
     finally:
         wlock.release()