[Updated] D8563: localrepo: get mergestate via context
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Thu Jun 11 17:04:57 UTC 2020
durin42 updated this revision to Diff 21619.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D8563?vs=21609&id=21619
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D8563/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D8563
AFFECTED FILES
mercurial/localrepo.py
tests/test-annotate.t
tests/test-fastannotate-hg.t
CHANGE DETAILS
diff --git a/tests/test-fastannotate-hg.t b/tests/test-fastannotate-hg.t
--- a/tests/test-fastannotate-hg.t
+++ b/tests/test-fastannotate-hg.t
@@ -484,7 +484,7 @@
> from mercurial import error, node
> def reposetup(ui, repo):
> class legacyrepo(repo.__class__):
- > def _filecommit(self, fctx, manifest1, manifest2,
+ > def _filecommit(self, ctx, fctx, manifest1, manifest2,
> linkrev, tr, changelist, includecopymeta):
> fname = fctx.path()
> text = fctx.data()
diff --git a/tests/test-annotate.t b/tests/test-annotate.t
--- a/tests/test-annotate.t
+++ b/tests/test-annotate.t
@@ -482,7 +482,7 @@
> from mercurial import error, node
> def reposetup(ui, repo):
> class legacyrepo(repo.__class__):
- > def _filecommit(self, fctx, manifest1, manifest2,
+ > def _filecommit(self, ctx, fctx, manifest1, manifest2,
> linkrev, tr, changelist, includecopymeta):
> fname = fctx.path()
> text = fctx.data()
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2474,7 +2474,7 @@
ui.status(
_(b'working directory now based on revision %d\n') % parents
)
- mergestatemod.mergestate.clean(self, self[b'.'].node())
+ self[None].mergestate(clean=True)
# TODO: if we know which new heads may result from this rollback, pass
# them to destroy(), which will prevent the branchhead cache from being
@@ -2775,6 +2775,7 @@
def _filecommit(
self,
+ ctx,
fctx,
manifest1,
manifest2,
@@ -2873,7 +2874,7 @@
fparent2 = nullid
elif not fparentancestors:
# TODO: this whole if-else might be simplified much more
- ms = mergestatemod.mergestate.read(self)
+ ms = ctx.mergestate()
if (
fname in ms
and ms[fname] == mergestatemod.MERGE_RECORD_MERGED_OTHER
@@ -2974,7 +2975,7 @@
self, status, text, user, date, extra
)
- ms = mergestatemod.mergestate.read(self)
+ ms = wctx.mergestate()
mergeutil.checkunresolved(ms)
# internal config: ui.allowemptycommit
@@ -3123,6 +3124,7 @@
else:
added.append(f)
m[f] = self._filecommit(
+ ctx,
fctx,
m1,
m2,
To: durin42, #hg-reviewers
Cc: marmoute, martinvonz, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200611/93f51a7e/attachment.html>
More information about the Mercurial-patches
mailing list