diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2553,7 +2553,7 @@ class _addset(abstractsmartset): val2 = None choice = max - if self._ascending: + if ascending: choice = min try: # Consume both iterators in an ordered way until one is diff --git a/tests/test-tag.t b/tests/test-tag.t --- a/tests/test-tag.t +++ b/tests/test-tag.t @@ -552,6 +552,12 @@ handle the loss of tags $ printf '' > .hgtags $ hg commit -m 'delete all tags' created new head + $ hg log -r 'max(t7::)' + changeset: 17:ffe462b50880 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: Added tag t7 for changeset fd3a9e394ce3 + $ hg update -r 'max(t7::)' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge -r tip --tool internal:tagmerge