Mercurial > hg
comparison hgext/largefiles/overrides.py @ 23483:3805f4b0f5a9
largefiles: remove redundant checks for false modify/delete conflicts
In a34a99181f36 (largefiles: don't show largefile/normal prompts if
one side is unchanged, 2014-12-01), overridecalculateupdates() started
checking for false modify/delete conflicts in large files and their
standins. Then, in the very next changeset, 902554884335 (merge:
before cd/dc prompt, check that changed side really changed,
2014-12-01), calculateupdates() itself started checking for false
modify/delete conflicts in all files. Since "large files and their
standins" is a subset of "all files", we can now drop the checks in
overridecalculateupdates().
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 05 Dec 2014 10:53:25 -0800 |
parents | 57b9c51cb4b4 |
children | da733837cdd0 |
comparison
equal
deleted
inserted
replaced
23482:208ec8ca7c79 | 23483:3805f4b0f5a9 |
---|---|
438 lfile = splitstandin | 438 lfile = splitstandin |
439 standin = f | 439 standin = f |
440 usermsg = _('remote turned local normal file %s into a largefile\n' | 440 usermsg = _('remote turned local normal file %s into a largefile\n' |
441 'use (l)argefile or keep (n)ormal file?' | 441 'use (l)argefile or keep (n)ormal file?' |
442 '$$ &Largefile $$ &Normal file') % lfile | 442 '$$ &Largefile $$ &Normal file') % lfile |
443 if (# local has unchanged normal file, pick remote largefile | 443 if repo.ui.promptchoice(usermsg, 0) == 0: # pick remote largefile |
444 pas and lfile in pas[0] and | |
445 not pas[0][lfile].cmp(p1[lfile]) or | |
446 # if remote has unchanged largefile, pick local normal file | |
447 not (pas and standin in pas[0] and | |
448 not pas[0][standin].cmp(p2[standin])) and | |
449 # else, prompt | |
450 repo.ui.promptchoice(usermsg, 0) == 0 | |
451 ): # pick remote largefile | |
452 actions['r'].append((lfile, None, 'replaced by standin')) | 444 actions['r'].append((lfile, None, 'replaced by standin')) |
453 newglist.append((standin, (p2.flags(standin),), msg)) | 445 newglist.append((standin, (p2.flags(standin),), msg)) |
454 else: # keep local normal file | 446 else: # keep local normal file |
455 actions['r'].append((standin, None, 'replaced by non-standin')) | 447 actions['r'].append((standin, None, 'replaced by non-standin')) |
456 elif lfutil.standin(f) in p1 and lfutil.standin(f) not in removes: | 448 elif lfutil.standin(f) in p1 and lfutil.standin(f) not in removes: |
459 standin = lfutil.standin(f) | 451 standin = lfutil.standin(f) |
460 lfile = f | 452 lfile = f |
461 usermsg = _('remote turned local largefile %s into a normal file\n' | 453 usermsg = _('remote turned local largefile %s into a normal file\n' |
462 'keep (l)argefile or use (n)ormal file?' | 454 'keep (l)argefile or use (n)ormal file?' |
463 '$$ &Largefile $$ &Normal file') % lfile | 455 '$$ &Largefile $$ &Normal file') % lfile |
464 if (# if remote has unchanged normal file, pick local largefile | 456 if repo.ui.promptchoice(usermsg, 0) == 0: # keep local largefile |
465 pas and f in pas[0] and | |
466 not pas[0][f].cmp(p2[f]) or | |
467 # if local has unchanged largefile, pick remote normal file | |
468 not (pas and standin in pas[0] and | |
469 not pas[0][standin].cmp(p1[standin])) and | |
470 # else, prompt | |
471 repo.ui.promptchoice(usermsg, 0) == 0 | |
472 ): # keep local largefile | |
473 if branchmerge: | 457 if branchmerge: |
474 # largefile can be restored from standin safely | 458 # largefile can be restored from standin safely |
475 actions['r'].append((lfile, None, 'replaced by standin')) | 459 actions['r'].append((lfile, None, 'replaced by standin')) |
476 else: | 460 else: |
477 # "lfile" should be marked as "removed" without | 461 # "lfile" should be marked as "removed" without |