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

login
register
mail settings
Submitter Jun Wu
Date March 16, 2017, 9:56 p.m.
Message ID <7b575fd8a7a1e9a96cd7.1489701417@localhost.localdomain>
Download mbox | patch
Permalink /patch/19405/
State Accepted
Headers show

Comments

Jun Wu - March 16, 2017, 9:56 p.m.
# HG changeset patch
# User Jun Wu <quark@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

Patch

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,