[Updated] [+- ] D9065: merge: make low-level update() private (API)
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Wed Sep 23 07:13:40 UTC 2020
martinvonz updated this revision to Diff 22767.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D9065?vs=22754&id=22767
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D9065/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D9065
AFFECTED FILES
hgext/largefiles/overrides.py
hgext/rebase.py
hgext/transplant.py
mercurial/hg.py
mercurial/merge.py
relnotes/next
CHANGE DETAILS
diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -20,3 +20,7 @@
== Internal API Changes ==
+ * `merge.update()` is now private (renamed to `_update()`). Hopefully
+ the higher-level functions available in the same module cover your
+ use cases.
+
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1700,7 +1700,7 @@
UPDATECHECK_NO_CONFLICT = b'noconflict'
-def update(
+def _update(
repo,
node,
branchmerge,
@@ -2051,7 +2051,7 @@
force = whether the merge was run with 'merge --force' (deprecated)
"""
- return update(
+ return _update(
ctx.repo(),
ctx.rev(),
labels=labels,
@@ -2068,7 +2068,7 @@
This involves updating to the commit and discarding any changes in the
working copy.
"""
- return update(ctx.repo(), ctx.rev(), branchmerge=False, force=True, wc=wc)
+ return _update(ctx.repo(), ctx.rev(), branchmerge=False, force=True, wc=wc)
def revert_to(ctx, matcher=None, wc=None):
@@ -2078,7 +2078,7 @@
be the same as in the given commit.
"""
- return update(
+ return _update(
ctx.repo(),
ctx.rev(),
branchmerge=False,
@@ -2129,7 +2129,7 @@
or pctx.rev() == base.rev()
)
- stats = update(
+ stats = _update(
repo,
ctx.node(),
True,
@@ -2172,7 +2172,7 @@
b"must specify parent of merge commit to back out"
)
parent = ctx.p1()
- return update(
+ return _update(
ctx.repo(),
parent,
branchmerge=True,
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -1049,7 +1049,7 @@
When overwrite is set, changes are clobbered, merged else
returns stats (see pydoc mercurial.merge.applyupdates)"""
- return mergemod.update(
+ return mergemod._update(
repo,
node,
branchmerge=False,
diff --git a/hgext/transplant.py b/hgext/transplant.py
--- a/hgext/transplant.py
+++ b/hgext/transplant.py
@@ -198,7 +198,7 @@
if pulls:
if source != repo:
exchange.pull(repo, source.peer(), heads=pulls)
- merge.update(
+ merge._update(
repo, pulls[-1], branchmerge=False, force=False
)
p1 = repo.dirstate.p1()
@@ -275,7 +275,7 @@
tr.close()
if pulls:
exchange.pull(repo, source.peer(), heads=pulls)
- merge.update(repo, pulls[-1], branchmerge=False, force=False)
+ merge._update(repo, pulls[-1], branchmerge=False, force=False)
finally:
self.saveseries(revmap, merges)
self.transplants.write()
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1497,7 +1497,7 @@
# See explanation in merge.graft()
mergeancestor = repo.changelog.isancestor(p1ctx.node(), ctx.node())
- stats = mergemod.update(
+ stats = mergemod._update(
repo,
rev,
branchmerge=True,
diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -1699,7 +1699,7 @@
return err
- at eh.wrapfunction(merge, b'update')
+ at eh.wrapfunction(merge, b'_update')
def mergeupdate(orig, repo, node, branchmerge, force, *args, **kwargs):
matcher = kwargs.get('matcher', None)
# note if this is a partial update
To: martinvonz, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200923/a9b9056d/attachment-0002.html>
More information about the Mercurial-patches
mailing list