diff mercurial/hg.py @ 39555:cb675e95a2c2

hg: write narrow patterns after repo creation Now that hg.clone() knows when a narrow clone is requested, it makes sense to have it update the narrow patterns for the repo soon after the repo is created, before any exchange occurs. Previously, the narrow extension was monkeypatching an exchange function to do this. The old code is redundant and has been removed. Differential Revision: https://phab.mercurial-scm.org/D4541
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 11 Sep 2018 17:22:15 -0700
parents 130e5df346d5
children c5e6c1ba1c79
line wrap: on
line diff
--- a/mercurial/hg.py	Tue Sep 11 16:59:17 2018 -0700
+++ b/mercurial/hg.py	Tue Sep 11 17:22:15 2018 -0700
@@ -737,6 +737,10 @@
                 revs = None
             local = destpeer.local()
             if local:
+                if narrow:
+                    with local.lock():
+                        local.setnarrowpats(storeincludepats, storeexcludepats)
+
                 u = util.url(abspath)
                 defaulturl = bytes(u)
                 local.ui.setconfig('paths', 'default', defaulturl, 'clone')