Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 26578:8bd2759f1fa7
dirstate: remove meaningless dirstateguard
Previous patch made dirstate changes in a transaction scope "all or
nothing". Therefore, 'dirstateguard' is meaningless, if its scope is
as same as one of the related transaction.
This patch removes such meaningless 'dirstateguard' usage.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 09 Oct 2015 03:53:46 +0900 |
parents | dd2f5e014806 |
children | dc2b8c005697 |
comparison
equal
deleted
inserted
replaced
26577:8f2ff40fe9c9 | 26578:8bd2759f1fa7 |
---|---|
2505 | 2505 |
2506 ui.note(_('amending changeset %s\n') % old) | 2506 ui.note(_('amending changeset %s\n') % old) |
2507 base = old.p1() | 2507 base = old.p1() |
2508 createmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt) | 2508 createmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt) |
2509 | 2509 |
2510 wlock = dsguard = lock = newid = None | 2510 wlock = lock = newid = None |
2511 try: | 2511 try: |
2512 wlock = repo.wlock() | 2512 wlock = repo.wlock() |
2513 dsguard = dirstateguard(repo, 'amend') | |
2514 lock = repo.lock() | 2513 lock = repo.lock() |
2515 tr = repo.transaction('amend') | 2514 tr = repo.transaction('amend') |
2516 try: | 2515 try: |
2517 # See if we got a message from -m or -l, if not, open the editor | 2516 # See if we got a message from -m or -l, if not, open the editor |
2518 # with the message of the changeset to amend | 2517 # with the message of the changeset to amend |
2680 | 2679 |
2681 obsolete.createmarkers(repo, obs) | 2680 obsolete.createmarkers(repo, obs) |
2682 tr.close() | 2681 tr.close() |
2683 finally: | 2682 finally: |
2684 tr.release() | 2683 tr.release() |
2685 dsguard.close() | |
2686 if not createmarkers and newid != old.node(): | 2684 if not createmarkers and newid != old.node(): |
2687 # Strip the intermediate commit (if there was one) and the amended | 2685 # Strip the intermediate commit (if there was one) and the amended |
2688 # commit | 2686 # commit |
2689 if node: | 2687 if node: |
2690 ui.note(_('stripping intermediate changeset %s\n') % ctx) | 2688 ui.note(_('stripping intermediate changeset %s\n') % ctx) |
2691 ui.note(_('stripping amended changeset %s\n') % old) | 2689 ui.note(_('stripping amended changeset %s\n') % old) |
2692 repair.strip(ui, repo, old.node(), topic='amend-backup') | 2690 repair.strip(ui, repo, old.node(), topic='amend-backup') |
2693 finally: | 2691 finally: |
2694 lockmod.release(lock, dsguard, wlock) | 2692 lockmod.release(lock, wlock) |
2695 return newid | 2693 return newid |
2696 | 2694 |
2697 def commiteditor(repo, ctx, subs, editform=''): | 2695 def commiteditor(repo, ctx, subs, editform=''): |
2698 if ctx.description(): | 2696 if ctx.description(): |
2699 return ctx.description() | 2697 return ctx.description() |