D6276: copies: clarify mutually exclusive cases in _chain() with a s/if/elif/
This revision was automatically updated to reflect the committed changes. Closed by commit rHG5a3979529740: copies: clarify mutually exclusive cases in _chain() with a s/if/elif/ (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6276?vs=14971=14983 REVISION DETAIL https://phab.mercurial-scm.org/D6276 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -134,7 +134,7 @@ if t[v] != k: # file wasn't renamed back to itself (i.e. case 4, not 3) t[k] = t[v] -if v in src: +elif v in src: # file is a copy of an existing file, i.e. case 6. t[k] = v To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6276: copies: clarify mutually exclusive cases in _chain() with a s/if/elif/
martinvonz updated this revision to Diff 14971. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6276?vs=14950=14971 REVISION DETAIL https://phab.mercurial-scm.org/D6276 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -134,7 +134,7 @@ if t[v] != k: # file wasn't renamed back to itself (i.e. case 4, not 3) t[k] = t[v] -if v in src: +elif v in src: # file is a copy of an existing file, i.e. case 6. t[k] = v To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6276: copies: clarify mutually exclusive cases in _chain() with a s/if/elif/
martinvonz updated this revision to Diff 14950. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6276?vs=14848=14950 REVISION DETAIL https://phab.mercurial-scm.org/D6276 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -134,7 +134,7 @@ if t[v] != k: # file wasn't renamed back to itself (i.e. case 4, not 3) t[k] = t[v] -if v in src: +elif v in src: # file is a copy of an existing file, i.e. case 6. t[k] = v To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6276: copies: clarify mutually exclusive cases in _chain() with a s/if/elif/
martinvonz updated this revision to Diff 14848. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6276?vs=14845=14848 REVISION DETAIL https://phab.mercurial-scm.org/D6276 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -134,7 +134,7 @@ if t[v] != k: # file wasn't renamed back to itself (i.e. case 4, not 3) t[k] = t[v] -if v in src: +elif v in src: # file is a copy of an existing file, i.e. case 6. t[k] = v To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6276: copies: clarify mutually exclusive cases in _chain() with a s/if/elif/
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY If the 'b' dict has a rename from 'x' to 'y', it shouldn't be possible for 'x' to be both (a key) in 'a' and in 'src'. That would mean that 'x' is a file in the source commit and also a rename destination in the intermediate commit. But we currently don't allow renaming files onto existing files, so that shouldn't happen. So let's clarify that by using an "elif" instead of an "if". And if we did allow renaming files onto existing files, we should prefer to use the rename destination in the intermediate commit as source anyway. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6276 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -134,7 +134,7 @@ if t[v] != k: # file wasn't renamed back to itself (i.e. case 4, not 3) t[k] = t[v] -if v in src: +elif v in src: # file is a copy of an existing file, i.e. case 6. t[k] = v To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel