D5510: narrow: reuse narrowspec.updateworkingcopy() when widening
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Mon Jan 7 08:46:20 UTC 2019
martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
The widening of the working copy we do after widening a repo is
practically the same as we do in a repo share after the store
narrowspec has been changed in a different share. Let's reuse the code
for that that we now have in the narrowspec module.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5510
AFFECTED FILES
hgext/narrow/narrowcommands.py
tests/test-narrow-widen-no-ellipsis.t
CHANGE DETAILS
diff --git a/tests/test-narrow-widen-no-ellipsis.t b/tests/test-narrow-widen-no-ellipsis.t
--- a/tests/test-narrow-widen-no-ellipsis.t
+++ b/tests/test-narrow-widen-no-ellipsis.t
@@ -128,7 +128,7 @@
added 0 changesets with 1 changes to 1 files
bundle2-input-part: total payload size * (glob)
bundle2-input-bundle: 0 parts total
- widest/f: add from widened narrow clone -> g
+ widest/f: narrowspec updated -> g
getting widest/f
$ hg tracked
I path:inside
diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -316,20 +316,10 @@
bundle2.processbundle(repo, bundle,
transactiongetter=tgetter)
- repo.setnewnarrowpats()
- narrowspec.copytoworkingcopy(repo)
- actions = merge.emptyactions()
- addgaction = actions['g'].append
-
- mf = repo['.'].manifest().matches(newmatch)
- for f, fn in mf.iteritems():
- if f not in repo.dirstate:
- addgaction((f, (mf.flags(f), False),
- "add from widened narrow clone"))
-
- merge.applyupdates(repo, actions, wctx=repo[None],
- mctx=repo['.'], overwrite=False)
- merge.recordupdates(repo, actions, branchmerge=False)
+ with repo.transaction('widening') as tr:
+ repo.setnewnarrowpats()
+ narrowspec.updateworkingcopy(repo, tr)
+ narrowspec.copytoworkingcopy(repo)
# TODO(rdamazio): Make new matcher format and update description
@command('tracked',
To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list