# HG changeset patch # User Pierre-Yves David # Date 1407274665 25200 # Node ID 122fa73657c66a7e3d6f9c3940d0606a7b82c385 # Parent 0aa2cb965f4c3b958eeedaa8a8f88a2e8a6cea35 shelve: do not retract phase boundary by hand We rely on the internal mechanism to commit the changeset in the right state. This is similar to what the mq extension is doing. This is an important change as we plan to move phase movement with the transaction. Avoiding phase movement from high level code will avoid them the burden of transaction handling. It is also important to limit the need for transaction handling as this limits the odds of people messing up. Most common expected mess-up is to use a different transaction for changesets creation and phase adjustment. diff -r 0aa2cb965f4c -r 122fa73657c6 hgext/shelve.py --- a/hgext/shelve.py Tue Aug 05 18:53:05 2014 -0700 +++ b/hgext/shelve.py Tue Aug 05 14:37:45 2014 -0700 @@ -177,11 +177,14 @@ hasmq = util.safehasattr(repo, 'mq') if hasmq: saved, repo.mq.checkapplied = repo.mq.checkapplied, False + backup = repo.ui.backupconfig('phases', 'new-commit') try: + repo.ui. setconfig('phases', 'new-commit', phases.secret) editor = cmdutil.getcommiteditor(editform='shelve.shelve', **opts) return repo.commit(message, user, opts.get('date'), match, editor=editor) finally: + repo.ui.restoreconfig(backup) if hasmq: repo.mq.checkapplied = saved @@ -235,8 +238,6 @@ ui.status(_("nothing changed\n")) return 1 - phases.retractboundary(repo, phases.secret, [node]) - fp = shelvedfile(repo, name, 'files').opener('wb') fp.write('\0'.join(shelvedfiles)) @@ -559,10 +560,13 @@ if hasmq: saved, repo.mq.checkapplied = repo.mq.checkapplied, False + backup = repo.ui.backupconfig('phases', 'new-commit') try: + repo.ui. setconfig('phases', 'new-commit', phases.secret) return repo.commit(message, 'shelve@localhost', opts.get('date'), match) finally: + repo.ui.restoreconfig(backup) if hasmq: repo.mq.checkapplied = saved