##// END OF EJS Templates
mergeactions: use action constants instead of string values...
Pulkit Goyal -
r45851:30f3e278 default
parent child Browse files
Show More
@@ -150,6 +150,7 b' from mercurial import ('
150 150 localrepo,
151 151 match as matchmod,
152 152 merge,
153 mergestate as mergestatemod,
153 154 node as nodemod,
154 155 patch,
155 156 pycompat,
@@ -484,7 +485,7 b' def applyupdates('
484 485 if isenabled(repo):
485 486 manifest = mctx.manifest()
486 487 files = []
487 for f, args, msg in actions[b'g']:
488 for f, args, msg in actions[mergestatemod.ACTION_GET]:
488 489 files.append((f, hex(manifest[f])))
489 490 # batch fetch the needed files from the server
490 491 repo.fileservice.prefetch(files)
@@ -499,9 +500,13 b' def checkunknownfiles(orig, repo, wctx, '
499 500 for f, (m, actionargs, msg) in pycompat.iteritems(mresult.actions):
500 501 if sparsematch and not sparsematch(f):
501 502 continue
502 if m in (b'c', b'dc', b'cm'):
503 if m in (
504 mergestatemod.ACTION_CREATED,
505 mergestatemod.ACTION_DELETED_CHANGED,
506 mergestatemod.ACTION_CREATED_MERGE,
507 ):
503 508 files.append((f, hex(mctx.filenode(f))))
504 elif m == b'dg':
509 elif m == mergestatemod.ACTION_LOCAL_DIR_RENAME_GET:
505 510 f2 = actionargs[0]
506 511 files.append((f2, hex(mctx.filenode(f2))))
507 512 # batch fetch the needed files from the server
@@ -395,17 +395,17 b' def filterupdatesactions(repo, wctx, mct'
395 395 files.add(file)
396 396 if sparsematch(file):
397 397 prunedactions[file] = action
398 elif type == b'm':
398 elif type == mergestatemod.ACTION_MERGE:
399 399 temporaryfiles.append(file)
400 400 prunedactions[file] = action
401 401 elif branchmerge:
402 if type != b'k':
402 if type != mergestatemod.ACTION_KEEP:
403 403 temporaryfiles.append(file)
404 404 prunedactions[file] = action
405 elif type == b'f':
405 elif type == mergestatemod.ACTION_FORGET:
406 406 prunedactions[file] = action
407 407 elif file in wctx:
408 prunedactions[file] = (b'r', args, msg)
408 prunedactions[file] = (mergestatemod.ACTION_REMOVE, args, msg)
409 409
410 410 if branchmerge and type == mergestatemod.ACTION_MERGE:
411 411 f1, f2, fa, move, anc = args
@@ -432,7 +432,7 b' def filterupdatesactions(repo, wctx, mct'
432 432 actions.append((file, (fctx.flags(), False), message))
433 433
434 434 typeactions = mergemod.emptyactions()
435 typeactions[b'g'] = actions
435 typeactions[mergestatemod.ACTION_GET] = actions
436 436 mergemod.applyupdates(
437 437 repo, typeactions, repo[None], repo[b'.'], False, wantfiledata=False
438 438 )
@@ -453,9 +453,13 b' def filterupdatesactions(repo, wctx, mct'
453 453 new = sparsematch(file)
454 454 if not old and new:
455 455 flags = mf.flags(file)
456 prunedactions[file] = (b'g', (flags, False), b'')
456 prunedactions[file] = (
457 mergestatemod.ACTION_GET,
458 (flags, False),
459 b'',
460 )
457 461 elif old and not new:
458 prunedactions[file] = (b'r', [], b'')
462 prunedactions[file] = (mergestatemod.ACTION_REMOVE, [], b'')
459 463
460 464 mresult.setactions(prunedactions)
461 465
General Comments 0
You need to be logged in to leave comments. Login now