comparison mercurial/copies.py @ 42118:967c098eed33

copies: move comment about implementation of mergecopies() to end When you start reading about mergecopies(), you want to know what it is, not that there are different implementations depending on config, so this patch moves that comment to the end. By the way, we don't seem to define what "copytracing" is. I'm just leaving it that way because I don't know what it is myself. It seems to be referred to only on mergecopies() (and not in pathcopies(), for example), so maybe "copytracing" is supposed to be exactly what mergecopies() does? Differential Revision: https://phab.mercurial-scm.org/D6235
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 02 Apr 2019 14:49:28 -0700
parents 27475ae67676
children 5382d8f8530b
comparison
equal deleted inserted replaced
42117:b287ed6eb9df 42118:967c098eed33
428 remainder[f] = ic 428 remainder[f] = ic
429 return remainder 429 return remainder
430 430
431 def mergecopies(repo, c1, c2, base): 431 def mergecopies(repo, c1, c2, base):
432 """ 432 """
433 The function calling different copytracing algorithms on the basis of config 433 Finds moves and copies between context c1 and c2 that are relevant for
434 which find moves and copies between context c1 and c2 that are relevant for
435 merging. 'base' will be used as the merge base. 434 merging. 'base' will be used as the merge base.
436 435
437 Copytracing is used in commands like rebase, merge, unshelve, etc to merge 436 Copytracing is used in commands like rebase, merge, unshelve, etc to merge
438 files that were moved/ copied in one merge parent and modified in another. 437 files that were moved/ copied in one merge parent and modified in another.
439 For example: 438 For example:
470 names for files deleted in c1 that were renamed in c2 or vice-versa. 469 names for files deleted in c1 that were renamed in c2 or vice-versa.
471 470
472 "dirmove" is a mapping of detected source dir -> destination dir renames. 471 "dirmove" is a mapping of detected source dir -> destination dir renames.
473 This is needed for handling changes to new files previously grafted into 472 This is needed for handling changes to new files previously grafted into
474 renamed directories. 473 renamed directories.
474
475 This function calls different copytracing algorithms based on config.
475 """ 476 """
476 # avoid silly behavior for update from empty dir 477 # avoid silly behavior for update from empty dir
477 if not c1 or not c2 or c1 == c2: 478 if not c1 or not c2 or c1 == c2:
478 return {}, {}, {}, {}, {} 479 return {}, {}, {}, {}, {}
479 480