mercurial/merge.py
changeset 4820 9797124581c9
parent 4815 8808ea7da86b
child 4890 931f901ab811
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -478,6 +478,9 @@ def recordupdates(repo, action, branchme
                     repo.dirstate.forget([f])
         elif m == "d": # directory rename
             f2, fd, flag = a[2:]
+            if not f2 and f not in repo.dirstate:
+                # untracked file moved
+                continue
             if branchmerge:
                 repo.dirstate.update([fd], 'a')
                 if f: