[PATCH 2 of 8] clone: get rid of ui.backupconfig

Jun Wu quark at fb.com
Thu Mar 16 17:56:57 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1489699130 25200
#      Thu Mar 16 14:18:50 2017 -0700
# Node ID 7b575fd8a7a1e9a96cd79352351d87ac69479270
# Parent  def9b72933ce717a48e3cc8fa4934bd3459b9479
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 7b575fd8a7a1
clone: get rid of ui.backupconfig

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -614,12 +614,8 @@ def clone(ui, peeropts, source, dest=Non
                         stream = None
                 # internal config: ui.quietbookmarkmove
-                quiet = local.ui.backupconfig('ui', 'quietbookmarkmove')
-                try:
-                    local.ui.setconfig(
-                        'ui', 'quietbookmarkmove', True, 'clone')
+                override = {('ui', 'quietbookmarkmove'): True}
+                with local.ui.configoverride(override, 'clone'):
                     exchange.pull(local, srcpeer, revs,
                                   streamclonerequested=stream)
-                finally:
-                    local.ui.restoreconfig(quiet)
             elif srcrepo:
                 exchange.push(srcrepo, destpeer, revs=revs,


More information about the Mercurial-devel mailing list