D3311: revset: use resolvehexnodeidprefix() in id() predicate (BC)
yuja added a comment. I've duplicated "BROKEN" lines as we get two "broken" results by this change. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3311 To: martinvonz, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D3311: revset: use resolvehexnodeidprefix() in id() predicate (BC)
I've duplicated "BROKEN" lines as we get two "broken" results by this change. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3311: revset: use resolvehexnodeidprefix() in id() predicate (BC)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG0a79fb64118e: revset: use resolvehexnodeidprefix() in id() predicate (BC) (authored by martinvonz, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D3311?vs=8489=8517#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3311?vs=8489=8517 REVISION DETAIL https://phab.mercurial-scm.org/D3311 AFFECTED FILES mercurial/revset.py tests/test-revset.t CHANGE DETAILS diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -1874,9 +1874,9 @@ $ hg debugrevspec '0:wdir() & fffb' abort: 00changelog.i@fffb: ambiguous identifier! [255] -BROKEN should be '2' (node lookup uses unfiltered repo since dc25ed84bee8) +BROKEN should be '2' (node lookup uses unfiltered repo) $ hg debugrevspec '0:wdir() & id(fffb)' - 2 +BROKEN should be '2' (node lookup uses unfiltered repo) $ hg debugrevspec '0:wdir() & 8' 4 $ hg debugrevspec '0:wdir() & f' diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1333,7 +1333,7 @@ else: rn = None try: -pm = repo.changelog._partialmatch(n) +pm = scmutil.resolvehexnodeidprefix(repo, n) if pm is not None: rn = repo.changelog.rev(pm) except LookupError: To: martinvonz, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3311: revset: use resolvehexnodeidprefix() in id() predicate (BC)
martinvonz updated this revision to Diff 8489. martinvonz edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3311?vs=8248=8489 REVISION DETAIL https://phab.mercurial-scm.org/D3311 AFFECTED FILES mercurial/revset.py tests/test-revset.t CHANGE DETAILS diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -1874,9 +1874,8 @@ $ hg debugrevspec '0:wdir() & fffb' abort: 00changelog.i@fffb: ambiguous identifier! [255] -BROKEN should be '2' (node lookup uses unfiltered repo since dc25ed84bee8) +BROKEN should be '2' (node lookup uses unfiltered repo) $ hg debugrevspec '0:wdir() & id(fffb)' - 2 $ hg debugrevspec '0:wdir() & 8' 4 $ hg debugrevspec '0:wdir() & f' diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1333,7 +1333,7 @@ else: rn = None try: -pm = repo.changelog._partialmatch(n) +pm = scmutil.resolvehexnodeidprefix(repo, n) if pm is not None: rn = repo.changelog.rev(pm) except LookupError: To: martinvonz, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3311: revset: use resolvehexnodeidprefix() in id() predicate (BC)
martinvonz reclaimed this revision. martinvonz added a comment. This revision now requires changes to proceed. Reviving this patch, but changing it so it doesn't result in an exception REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3311 To: martinvonz, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3311: revset: use resolvehexnodeidprefix() in id() predicate (BC)
martinvonz added a comment. In https://phab.mercurial-scm.org/D3311#53712, @yuja wrote: > I have vague memory that it was intentional. Since `rev()` and `id()` never > error out on unknown identifier, it doesn't make sense to reject only > ambiguous nodeid. I'm fine with dropping this patch. The rest of the stack doesn't depend on it anyway. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3311 To: martinvonz, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3311: revset: use resolvehexnodeidprefix() in id() predicate (BC)
yuja requested changes to this revision. yuja added a comment. This revision now requires changes to proceed. I have vague memory that it was intentional. Since `rev()` and `id()` never error out on unknown identifier, it doesn't make sense to reject only ambiguous nodeid. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3311 To: martinvonz, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3311: revset: use resolvehexnodeidprefix() in id() predicate (BC)
martinvonz updated this revision to Diff 8248. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3311?vs=8117=8248 REVISION DETAIL https://phab.mercurial-scm.org/D3311 AFFECTED FILES mercurial/revset.py tests/test-revset.t CHANGE DETAILS diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -1878,7 +1878,8 @@ [255] BROKEN should be '2' (node lookup uses unfiltered repo since dc25ed84bee8) $ hg debugrevspec '0:wdir() & id(fffb)' - 2 + abort: 00changelog.i@fffb: ambiguous identifier! + [255] $ hg debugrevspec '0:wdir() & 8' 4 $ hg debugrevspec '0:wdir() & f' diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1333,7 +1333,7 @@ else: rn = None try: -pm = repo.changelog._partialmatch(n) +pm = scmutil.resolvehexnodeidprefix(repo, n) if pm is not None: rn = repo.changelog.rev(pm) except error.WdirUnsupported: 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
D3311: revset: use resolvehexnodeidprefix() in id() predicate (BC)
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We now have a public method for this purpose, so we don't need to access the private revlog._partialmatch(). Also, I'll probably make some changes to resolvehexnodeidprefix() later, and I want those to be reflected by the id() predicate. Note that this breaks a test case, because we now resolve the prefix in the unfiltered repo and get an ambiguous lookup. The test case was already documented to be broken even though it wasn't. The new behavior is more consistent: now "hg co ffb" and "hg co 'id(ffb)'" behaves the same. We should fix both of them at once later instead. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3311 AFFECTED FILES mercurial/revset.py tests/test-revset.t CHANGE DETAILS diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -1878,7 +1878,8 @@ [255] BROKEN should be '2' (node lookup uses unfiltered repo since dc25ed84bee8) $ hg debugrevspec '0:wdir() & id(fffb)' - 2 + abort: 00changelog.i@fffb: ambiguous identifier! + [255] $ hg debugrevspec '0:wdir() & 8' 4 $ hg debugrevspec '0:wdir() & f' diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1333,7 +1333,7 @@ else: rn = None try: -pm = repo.changelog._partialmatch(n) +pm = scmutil.resolvehexnodeidprefix(repo, n) if pm is not None: rn = repo.changelog.rev(pm) except error.WdirUnsupported: 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