Mercurial > hg
changeset 11047:c7dbd6c4877a
tags: return tags in sorted order
This makes log and summary have less arbitrary tag ordering and also
groups similar tags together, such as the mq tags.
author | Eric Eisner <ede@mit.edu> |
---|---|
date | Mon, 26 Apr 2010 15:58:36 -0400 |
parents | 6e9b9f6c117c |
children | 9e643a0c3278 |
files | mercurial/localrepo.py tests/test-bookmarks-rebase.out tests/test-mq-qimport.out tests/test-mq.out tests/test-qrecord.out tests/test-rebase-mq-skip.out tests/test-rebase-mq.out tests/test-tag.out |
diffstat | 8 files changed, 16 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Mon Apr 26 04:01:13 2010 +0200 +++ b/mercurial/localrepo.py Mon Apr 26 15:58:36 2010 -0400 @@ -315,6 +315,8 @@ self.nodetagscache = {} for t, n in self.tags().iteritems(): self.nodetagscache.setdefault(n, []).append(t) + for tags in self.nodetagscache.itervalues(): + tags.sort() return self.nodetagscache.get(node, []) def _branchtags(self, partial, lrev):
--- a/tests/test-bookmarks-rebase.out Mon Apr 26 04:01:13 2010 +0200 +++ b/tests/test-bookmarks-rebase.out Mon Apr 26 15:58:36 2010 -0400 @@ -17,9 +17,9 @@ added 1 changesets with 1 changes to 1 files (-1 heads) rebase completed changeset: 3:9163974d1cb5 +tag: one tag: tip tag: two -tag: one parent: 1:925d80f479bb parent: 2:db815d6d32e6 user: test
--- a/tests/test-mq-qimport.out Mon Apr 26 04:01:13 2010 +0200 +++ b/tests/test-mq-qimport.out Mon Apr 26 15:58:36 2010 -0400 @@ -6,10 +6,10 @@ now at: email % hg tip -v changeset: 0:1a706973a7d8 +tag: email +tag: qbase tag: qtip tag: tip -tag: email -tag: qbase user: Username in patch <test@example.net> date: Thu Jan 01 00:00:00 1970 +0000 files: x
--- a/tests/test-mq.out Mon Apr 26 04:01:13 2010 +0200 +++ b/tests/test-mq.out Mon Apr 26 15:58:36 2010 -0400 @@ -357,8 +357,8 @@ ? foo.rej % mq tags 0 qparent -1 qbase foo -2 qtip bar tip +1 foo qbase +2 bar qtip tip % bad node in status popping bar now at: foo @@ -577,10 +577,10 @@ hello +world changeset: 1:bf5fc3f07a0a +tag: empty +tag: qbase tag: qtip tag: tip -tag: empty -tag: qbase user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: imported patch empty
--- a/tests/test-qrecord.out Mon Apr 26 04:01:13 2010 +0200 +++ b/tests/test-qrecord.out Mon Apr 26 15:58:36 2010 -0400 @@ -110,10 +110,10 @@ % after qrecord a.patch 'tip' changeset: 1:5d1ca63427ee +tag: a.patch +tag: qbase tag: qtip tag: tip -tag: a.patch -tag: qbase user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: aaa @@ -185,9 +185,9 @@ % after qrecord b.patch 'tip' changeset: 2:b056198bf878 +tag: b.patch tag: qtip tag: tip -tag: b.patch user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: bbb
--- a/tests/test-rebase-mq-skip.out Mon Apr 26 04:01:13 2010 +0200 +++ b/tests/test-rebase-mq-skip.out Mon Apr 26 15:58:36 2010 -0400 @@ -13,7 +13,7 @@ adding file changes added 2 changesets with 2 changes to 2 files rebase completed -@ 3 P0 tags: p0.patch qtip tip qbase +@ 3 P0 tags: p0.patch qbase qtip tip | o 2 P1 tags: qparent |
--- a/tests/test-rebase-mq.out Mon Apr 26 04:01:13 2010 +0200 +++ b/tests/test-rebase-mq.out Mon Apr 26 15:58:36 2010 -0400 @@ -1,5 +1,5 @@ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved -@ 3 P1 tags: qtip tip f2.patch +@ 3 P1 tags: f2.patch qtip tip | o 2 P0 tags: f.patch qbase | @@ -34,7 +34,7 @@ adding file changes added 2 changesets with 2 changes to 1 files rebase completed -@ 3 P1 tags: qtip tip f2.patch +@ 3 P1 tags: f2.patch qtip tip | o 2 P0 tags: f.patch qbase |
--- a/tests/test-tag.out Mon Apr 26 04:01:13 2010 +0200 +++ b/tests/test-tag.out Mon Apr 26 15:58:36 2010 -0400 @@ -49,9 +49,9 @@ abort: ':' cannot be used in a tag name % cloning local tags changeset: 0:0acdaf898367 -tag: foobar tag: bleah tag: bleah0 +tag: foobar user: test date: Mon Jan 12 13:46:40 1970 +0000 summary: test