##// END OF EJS Templates
shelve: move ui.quiet manipulations to configoverride
Kostia Balytskyi -
r31757:473f2fcc default
parent child Browse files
Show More
@@ -592,9 +592,7 b' def unshelveabort(ui, repo, state, opts)'
592 592 def mergefiles(ui, repo, wctx, shelvectx):
593 593 """updates to wctx and merges the changes from shelvectx into the
594 594 dirstate."""
595 oldquiet = ui.quiet
596 try:
597 ui.quiet = True
595 with ui.configoverride({('ui', 'quiet'): True}):
598 596 hg.update(repo, wctx.node())
599 597 files = []
600 598 files.extend(shelvectx.files())
@@ -609,8 +607,6 b' def mergefiles(ui, repo, wctx, shelvectx'
609 607 *pathtofiles(repo, files),
610 608 **{'no_backup': True})
611 609 ui.popbuffer()
612 finally:
613 ui.quiet = oldquiet
614 610
615 611 def restorebranch(ui, repo, branchtorestore):
616 612 if branchtorestore and branchtorestore != repo.dirstate.branch():
@@ -680,17 +676,16 b' def _commitworkingcopychanges(ui, repo, '
680 676 tempopts = {}
681 677 tempopts['message'] = "pending changes temporary commit"
682 678 tempopts['date'] = opts.get('date')
683 ui.quiet = True
684 node = cmdutil.commit(ui, repo, commitfunc, [], tempopts)
679 with ui.configoverride({('ui', 'quiet'): True}):
680 node = cmdutil.commit(ui, repo, commitfunc, [], tempopts)
685 681 tmpwctx = repo[node]
686 682 return tmpwctx, addedbefore
687 683
688 def _unshelverestorecommit(ui, repo, basename, oldquiet):
684 def _unshelverestorecommit(ui, repo, basename):
689 685 """Recreate commit in the repository during the unshelve"""
690 ui.quiet = True
691 shelvedfile(repo, basename, 'hg').applybundle()
692 shelvectx = repo['tip']
693 ui.quiet = oldquiet
686 with ui.configoverride({('ui', 'quiet'): True}):
687 shelvedfile(repo, basename, 'hg').applybundle()
688 shelvectx = repo['tip']
694 689 return repo, shelvectx
695 690
696 691 def _rebaserestoredcommit(ui, repo, opts, tr, oldtiprev, basename, pctx,
@@ -873,11 +868,9 b' def _dounshelve(ui, repo, *shelved, **op'
873 868 if not shelvedfile(repo, basename, patchextension).exists():
874 869 raise error.Abort(_("shelved change '%s' not found") % basename)
875 870
876 oldquiet = ui.quiet
877 871 lock = tr = None
878 872 try:
879 873 lock = repo.lock()
880
881 874 tr = repo.transaction('unshelve', report=lambda x: None)
882 875 oldtiprev = len(repo)
883 876
@@ -894,9 +887,7 b' def _dounshelve(ui, repo, *shelved, **op'
894 887 with ui.configoverride(overrides, 'unshelve'):
895 888 tmpwctx, addedbefore = _commitworkingcopychanges(ui, repo, opts,
896 889 tmpwctx)
897
898 repo, shelvectx = _unshelverestorecommit(ui, repo, basename,
899 oldquiet)
890 repo, shelvectx = _unshelverestorecommit(ui, repo, basename)
900 891 _checkunshelveuntrackedproblems(ui, repo, shelvectx)
901 892 branchtorestore = ''
902 893 if shelvectx.branch() != shelvectx.p1().branch():
@@ -914,7 +905,6 b' def _dounshelve(ui, repo, *shelved, **op'
914 905 _finishunshelve(repo, oldtiprev, tr, activebookmark)
915 906 unshelvecleanup(ui, repo, basename, opts)
916 907 finally:
917 ui.quiet = oldquiet
918 908 if tr:
919 909 tr.release()
920 910 lockmod.release(lock)
General Comments 0
You need to be logged in to leave comments. Login now