clone: get rid of ui.backupconfig
authorJun Wu <quark@fb.com>
Thu, 16 Mar 2017 14:18:50 -0700
changeset 31456 2545ee88a57e
parent 31455 7b5fb4b0c0e8
child 31457 707f9fd2dcad
clone: get rid of ui.backupconfig
mercurial/hg.py
--- a/mercurial/hg.py	Thu Mar 16 14:15:20 2017 -0700
+++ b/mercurial/hg.py	Thu Mar 16 14:18:50 2017 -0700
@@ -613,14 +613,10 @@
                     else:
                         stream = None
                 # internal config: ui.quietbookmarkmove
-                quiet = local.ui.backupconfig('ui', 'quietbookmarkmove')
-                try:
-                    local.ui.setconfig(
-                        'ui', 'quietbookmarkmove', True, 'clone')
+                overrides = {('ui', 'quietbookmarkmove'): True}
+                with local.ui.configoverride(overrides, 'clone'):
                     exchange.pull(local, srcpeer, revs,
                                   streamclonerequested=stream)
-                finally:
-                    local.ui.restoreconfig(quiet)
             elif srcrepo:
                 exchange.push(srcrepo, destpeer, revs=revs,
                               bookmarks=srcrepo._bookmarks.keys())