[Request] [+- ] D8744: merge: remove no longer required ACTION_GET_OTHER_AND_STORE
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Tue Jul 14 12:33:01 UTC 2020
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
In 1b8fd4af33189c84feadb47c74d659ec31cde3b9 <https://phab.mercurial-scm.org/rHG1b8fd4af33189c84feadb47c74d659ec31cde3b9> I (ab)used merge actions to pass
info from manifestmerge() to applyupdates() and store info in mergestate.
In previous patches, we introduced a separate return value from manifestmerge()
and calculateupdates() and an argument to applyupdates() which achieved the same
thing.
Let's remove this no longer required messy code.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D8744
AFFECTED FILES
mercurial/merge.py
mercurial/mergestate.py
CHANGE DETAILS
diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -113,8 +113,6 @@
ACTION_KEEP = b'k'
ACTION_EXEC = b'e'
ACTION_CREATED_MERGE = b'cm'
-# GET the other/remote side and store this info in mergestate
-ACTION_GET_OTHER_AND_STORE = b'gs'
class mergestate(object):
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -671,9 +671,7 @@
)
else:
actions[f] = (
- mergestatemod.ACTION_GET_OTHER_AND_STORE
- if branchmerge
- else mergestatemod.ACTION_GET,
+ mergestatemod.ACTION_GET,
(fl2, False),
b'remote is newer',
)
@@ -687,9 +685,7 @@
)
elif nol and n1 == a: # local only changed 'x'
actions[f] = (
- mergestatemod.ACTION_GET_OTHER_AND_STORE
- if branchmerge
- else mergestatemod.ACTION_GET,
+ mergestatemod.ACTION_GET,
(fl1, False),
b'remote is newer',
)
@@ -961,8 +957,6 @@
for f, a in sorted(pycompat.iteritems(actions)):
m, args, msg = a
- if m == mergestatemod.ACTION_GET_OTHER_AND_STORE:
- m = mergestatemod.ACTION_GET
repo.ui.debug(b' %s: %s -> %s\n' % (f, msg, m))
if f in fbids:
d = fbids[f]
@@ -1194,7 +1188,6 @@
mergestatemod.ACTION_KEEP,
mergestatemod.ACTION_PATH_CONFLICT,
mergestatemod.ACTION_PATH_CONFLICT_RESOLVE,
- mergestatemod.ACTION_GET_OTHER_AND_STORE,
)
}
@@ -1238,10 +1231,6 @@
if op == b'other':
ms.addmergedother(f)
- # add ACTION_GET_OTHER_AND_STORE to mergestate
- for e in actions[mergestatemod.ACTION_GET_OTHER_AND_STORE]:
- ms.addmergedother(e[0])
-
moves = []
for m, l in actions.items():
l.sort()
@@ -1784,7 +1773,6 @@
mergestatemod.ACTION_EXEC,
mergestatemod.ACTION_REMOVE,
mergestatemod.ACTION_PATH_CONFLICT_RESOLVE,
- mergestatemod.ACTION_GET_OTHER_AND_STORE,
):
msg = _(b"conflicting changes")
hint = _(b"commit or update --clean to discard changes")
@@ -1855,10 +1843,6 @@
actions[m] = []
actions[m].append((f, args, msg))
- # ACTION_GET_OTHER_AND_STORE is a mergestatemod.ACTION_GET + store in mergestate
- for e in actions[mergestatemod.ACTION_GET_OTHER_AND_STORE]:
- actions[mergestatemod.ACTION_GET].append(e)
-
if not util.fscasesensitive(repo.path):
# check collision between files only in p2 for clean update
if not branchmerge and (
To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200714/5a2f7d98/attachment.html>
More information about the Mercurial-patches
mailing list