8 from node import hex, nullid, nullrev, short |
8 from node import hex, nullid, nullrev, short |
9 from i18n import _ |
9 from i18n import _ |
10 import os, sys, errno, re, tempfile |
10 import os, sys, errno, re, tempfile |
11 import util, scmutil, templater, patch, error, templatekw, revlog, copies |
11 import util, scmutil, templater, patch, error, templatekw, revlog, copies |
12 import match as matchmod |
12 import match as matchmod |
13 import subrepo, context, repair, bookmarks, graphmod, revset, phases, obsolete |
13 import subrepo, context, repair, graphmod, revset, phases, obsolete |
14 import changelog |
14 import changelog |
15 import lock as lockmod |
15 import lock as lockmod |
16 |
16 |
17 def parsealiases(cmd): |
17 def parsealiases(cmd): |
18 return cmd.lstrip("^").split("|") |
18 return cmd.lstrip("^").split("|") |
1754 repo.setparents(newid, nullid) |
1754 repo.setparents(newid, nullid) |
1755 |
1755 |
1756 # Move bookmarks from old parent to amend commit |
1756 # Move bookmarks from old parent to amend commit |
1757 bms = repo.nodebookmarks(old.node()) |
1757 bms = repo.nodebookmarks(old.node()) |
1758 if bms: |
1758 if bms: |
|
1759 marks = repo._bookmarks |
1759 for bm in bms: |
1760 for bm in bms: |
1760 repo._bookmarks[bm] = newid |
1761 marks[bm] = newid |
1761 bookmarks.write(repo) |
1762 marks.write() |
1762 #commit the whole amend process |
1763 #commit the whole amend process |
1763 if obsolete._enabled and newid != old.node(): |
1764 if obsolete._enabled and newid != old.node(): |
1764 # mark the new changeset as successor of the rewritten one |
1765 # mark the new changeset as successor of the rewritten one |
1765 new = repo[newid] |
1766 new = repo[newid] |
1766 obs = [(old, (new,))] |
1767 obs = [(old, (new,))] |