Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 22951:6c86c673dde6
obsolete: add createmarkers option
The basic obsolete option is allowing the creation of obsolete markers. This
does not enable other features, such as allowing unstable commits or exchanging
obsolete markers.
author | Durham Goode <durham@fb.com> |
---|---|
date | Tue, 14 Oct 2014 13:23:52 -0700 |
parents | 722117c8e023 |
children | b564330d4b1f |
comparison
equal
deleted
inserted
replaced
22950:bb8278b289ee | 22951:6c86c673dde6 |
---|---|
2281 marks = repo._bookmarks | 2281 marks = repo._bookmarks |
2282 for bm in bms: | 2282 for bm in bms: |
2283 marks[bm] = newid | 2283 marks[bm] = newid |
2284 marks.write() | 2284 marks.write() |
2285 #commit the whole amend process | 2285 #commit the whole amend process |
2286 if obsolete._enabled and newid != old.node(): | 2286 createmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt) |
2287 if createmarkers and newid != old.node(): | |
2287 # mark the new changeset as successor of the rewritten one | 2288 # mark the new changeset as successor of the rewritten one |
2288 new = repo[newid] | 2289 new = repo[newid] |
2289 obs = [(old, (new,))] | 2290 obs = [(old, (new,))] |
2290 if node: | 2291 if node: |
2291 obs.append((ctx, ())) | 2292 obs.append((ctx, ())) |
2292 | 2293 |
2293 obsolete.createmarkers(repo, obs) | 2294 obsolete.createmarkers(repo, obs) |
2294 tr.close() | 2295 tr.close() |
2295 finally: | 2296 finally: |
2296 tr.release() | 2297 tr.release() |
2297 if (not obsolete._enabled) and newid != old.node(): | 2298 if not createmarkers and newid != old.node(): |
2298 # Strip the intermediate commit (if there was one) and the amended | 2299 # Strip the intermediate commit (if there was one) and the amended |
2299 # commit | 2300 # commit |
2300 if node: | 2301 if node: |
2301 ui.note(_('stripping intermediate changeset %s\n') % ctx) | 2302 ui.note(_('stripping intermediate changeset %s\n') % ctx) |
2302 ui.note(_('stripping amended changeset %s\n') % old) | 2303 ui.note(_('stripping amended changeset %s\n') % old) |