##// END OF EJS Templates
merge: pass commitinfo to applyupdates() and get it stored in mergestate...
Pulkit Goyal -
r45833:cb6a72dc default
parent child Browse files
Show More
@@ -479,7 +479,7 b' def storewrapper(orig, requirements, pat'
479
479
480 # prefetch files before update
480 # prefetch files before update
481 def applyupdates(
481 def applyupdates(
482 orig, repo, actions, wctx, mctx, overwrite, wantfiledata, labels=None
482 orig, repo, actions, wctx, mctx, overwrite, wantfiledata, **opts
483 ):
483 ):
484 if isenabled(repo):
484 if isenabled(repo):
485 manifest = mctx.manifest()
485 manifest = mctx.manifest()
@@ -488,9 +488,7 b' def applyupdates('
488 files.append((f, hex(manifest[f])))
488 files.append((f, hex(manifest[f])))
489 # batch fetch the needed files from the server
489 # batch fetch the needed files from the server
490 repo.fileservice.prefetch(files)
490 repo.fileservice.prefetch(files)
491 return orig(
491 return orig(repo, actions, wctx, mctx, overwrite, wantfiledata, **opts)
492 repo, actions, wctx, mctx, overwrite, wantfiledata, labels=labels
493 )
494
492
495
493
496 # Prefetch merge checkunknownfiles
494 # Prefetch merge checkunknownfiles
@@ -1241,12 +1241,21 b' def emptyactions():'
1241
1241
1242
1242
1243 def applyupdates(
1243 def applyupdates(
1244 repo, actions, wctx, mctx, overwrite, wantfiledata, labels=None
1244 repo,
1245 actions,
1246 wctx,
1247 mctx,
1248 overwrite,
1249 wantfiledata,
1250 labels=None,
1251 commitinfo=None,
1245 ):
1252 ):
1246 """apply the merge action list to the working directory
1253 """apply the merge action list to the working directory
1247
1254
1248 wctx is the working copy context
1255 wctx is the working copy context
1249 mctx is the context to be merged into the working copy
1256 mctx is the context to be merged into the working copy
1257 commitinfo is a mapping of information which needs to be stored somewhere
1258 (probably mergestate) so that it can be used at commit time.
1250
1259
1251 Return a tuple of (counts, filedata), where counts is a tuple
1260 Return a tuple of (counts, filedata), where counts is a tuple
1252 (updated, merged, removed, unresolved) that describes how many
1261 (updated, merged, removed, unresolved) that describes how many
@@ -1261,6 +1270,15 b' def applyupdates('
1261 repo, wctx.p1().node(), mctx.node(), labels
1270 repo, wctx.p1().node(), mctx.node(), labels
1262 )
1271 )
1263
1272
1273 if commitinfo is None:
1274 commitinfo = {}
1275
1276 for f, op in pycompat.iteritems(commitinfo):
1277 # the other side of filenode was choosen while merging, store this in
1278 # mergestate so that it can be reused on commit
1279 if op == b'other':
1280 ms.addmergedother(f)
1281
1264 # add ACTION_GET_OTHER_AND_STORE to mergestate
1282 # add ACTION_GET_OTHER_AND_STORE to mergestate
1265 for e in actions[mergestatemod.ACTION_GET_OTHER_AND_STORE]:
1283 for e in actions[mergestatemod.ACTION_GET_OTHER_AND_STORE]:
1266 ms.addmergedother(e[0])
1284 ms.addmergedother(e[0])
@@ -1935,7 +1953,14 b' def update('
1935
1953
1936 wantfiledata = updatedirstate and not branchmerge
1954 wantfiledata = updatedirstate and not branchmerge
1937 stats, getfiledata = applyupdates(
1955 stats, getfiledata = applyupdates(
1938 repo, actions, wc, p2, overwrite, wantfiledata, labels=labels
1956 repo,
1957 actions,
1958 wc,
1959 p2,
1960 overwrite,
1961 wantfiledata,
1962 labels=labels,
1963 commitinfo=mresult.commitinfo,
1939 )
1964 )
1940
1965
1941 if updatedirstate:
1966 if updatedirstate:
General Comments 0
You need to be logged in to leave comments. Login now