Show More
@@ -2594,17 +2594,20 b' def tag(ui, repo, name, rev_=None, **opt' | |||||
2594 | if opts['rev']: |
|
2594 | if opts['rev']: | |
2595 | rev_ = opts['rev'] |
|
2595 | rev_ = opts['rev'] | |
2596 | if rev_: |
|
2596 | if rev_: | |
2597 |
r = |
|
2597 | r = repo.lookup(rev_) | |
2598 | else: |
|
2598 | else: | |
2599 | p1, p2 = repo.dirstate.parents() |
|
2599 | p1, p2 = repo.dirstate.parents() | |
2600 | if p1 == nullid: |
|
2600 | if p1 == nullid: | |
2601 | raise util.Abort(_('no revision to tag')) |
|
2601 | raise util.Abort(_('no revision to tag')) | |
2602 | if p2 != nullid: |
|
2602 | if p2 != nullid: | |
2603 | raise util.Abort(_('outstanding uncommitted merges')) |
|
2603 | raise util.Abort(_('outstanding uncommitted merges')) | |
2604 |
r = |
|
2604 | r = p1 | |
2605 |
|
2605 | |||
2606 | repo.tag(name, r, opts['local'], opts['message'], opts['user'], |
|
2606 | message = opts['message'] | |
2607 | opts['date']) |
|
2607 | if not message: | |
|
2608 | message = _('Added tag %s for changeset %s') % (name, short(r)) | |||
|
2609 | ||||
|
2610 | repo.tag(name, r, message, opts['local'], opts['user'], opts['date']) | |||
2608 |
|
2611 | |||
2609 | def tags(ui, repo): |
|
2612 | def tags(ui, repo): | |
2610 | """list repository tags |
|
2613 | """list repository tags |
@@ -169,7 +169,7 b' class localrepository(repo.repository):' | |||||
169 |
|
169 | |||
170 | tag_disallowed = ':\r\n' |
|
170 | tag_disallowed = ':\r\n' | |
171 |
|
171 | |||
172 |
def tag(self, name, node, |
|
172 | def tag(self, name, node, message, local, user, date): | |
173 | '''tag a revision with a symbolic name. |
|
173 | '''tag a revision with a symbolic name. | |
174 |
|
174 | |||
175 | if local is True, the tag is stored in a per-repository file. |
|
175 | if local is True, the tag is stored in a per-repository file. | |
@@ -191,11 +191,11 b' class localrepository(repo.repository):' | |||||
191 | if c in name: |
|
191 | if c in name: | |
192 | raise util.Abort(_('%r cannot be used in a tag name') % c) |
|
192 | raise util.Abort(_('%r cannot be used in a tag name') % c) | |
193 |
|
193 | |||
194 | self.hook('pretag', throw=True, node=node, tag=name, local=local) |
|
194 | self.hook('pretag', throw=True, node=hex(node), tag=name, local=local) | |
195 |
|
195 | |||
196 | if local: |
|
196 | if local: | |
197 | self.opener('localtags', 'a').write('%s %s\n' % (node, name)) |
|
197 | self.opener('localtags', 'a').write('%s %s\n' % (hex(node), name)) | |
198 | self.hook('tag', node=node, tag=name, local=local) |
|
198 | self.hook('tag', node=hex(node), tag=name, local=local) | |
199 | return |
|
199 | return | |
200 |
|
200 | |||
201 | for x in self.status()[:5]: |
|
201 | for x in self.status()[:5]: | |
@@ -203,15 +203,12 b' class localrepository(repo.repository):' | |||||
203 | raise util.Abort(_('working copy of .hgtags is changed ' |
|
203 | raise util.Abort(_('working copy of .hgtags is changed ' | |
204 | '(please commit .hgtags manually)')) |
|
204 | '(please commit .hgtags manually)')) | |
205 |
|
205 | |||
206 | self.wfile('.hgtags', 'ab').write('%s %s\n' % (node, name)) |
|
206 | self.wfile('.hgtags', 'ab').write('%s %s\n' % (hex(node), name)) | |
207 | if self.dirstate.state('.hgtags') == '?': |
|
207 | if self.dirstate.state('.hgtags') == '?': | |
208 | self.add(['.hgtags']) |
|
208 | self.add(['.hgtags']) | |
209 |
|
209 | |||
210 | if not message: |
|
|||
211 | message = _('Added tag %s for changeset %s') % (name, node) |
|
|||
212 |
|
||||
213 | self.commit(['.hgtags'], message, user, date) |
|
210 | self.commit(['.hgtags'], message, user, date) | |
214 | self.hook('tag', node=node, tag=name, local=local) |
|
211 | self.hook('tag', node=hex(node), tag=name, local=local) | |
215 |
|
212 | |||
216 | def tags(self): |
|
213 | def tags(self): | |
217 | '''return a mapping of tag to node''' |
|
214 | '''return a mapping of tag to node''' |
@@ -36,43 +36,43 b' added 3 changesets with 2 changes to 2 f' | |||||
36 | (run 'hg update' to get a working copy) |
|
36 | (run 'hg update' to get a working copy) | |
37 | pretag hook: t=a n=4c52fb2e402287dd5dc052090682536c8406c321 l=0 |
|
37 | pretag hook: t=a n=4c52fb2e402287dd5dc052090682536c8406c321 l=0 | |
38 | precommit hook: p1=4c52fb2e402287dd5dc052090682536c8406c321 p2= |
|
38 | precommit hook: p1=4c52fb2e402287dd5dc052090682536c8406c321 p2= | |
39 |
pretxncommit hook: n= |
|
39 | pretxncommit hook: n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p1=4c52fb2e402287dd5dc052090682536c8406c321 p2= | |
40 | 4:4f92e785b90a |
|
40 | 4:8ea2ef7ad3e8 | |
41 |
commit hook: n= |
|
41 | commit hook: n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p1=4c52fb2e402287dd5dc052090682536c8406c321 p2= | |
42 | commit hook b |
|
42 | commit hook b | |
43 | tag hook: t=a n=4c52fb2e402287dd5dc052090682536c8406c321 l=0 |
|
43 | tag hook: t=a n=4c52fb2e402287dd5dc052090682536c8406c321 l=0 | |
44 | pretag hook: t=la n=4f92e785b90ae8995dfe156e39dd4fbc3b346a24 l=1 |
|
44 | pretag hook: t=la n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 l=1 | |
45 | tag hook: t=la n=4f92e785b90ae8995dfe156e39dd4fbc3b346a24 l=1 |
|
45 | tag hook: t=la n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 l=1 | |
46 | pretag hook: t=fa n=4f92e785b90ae8995dfe156e39dd4fbc3b346a24 l=0 |
|
46 | pretag hook: t=fa n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 l=0 | |
47 | pretag.forbid hook |
|
47 | pretag.forbid hook | |
48 | abort: pretag.forbid hook exited with status 1 |
|
48 | abort: pretag.forbid hook exited with status 1 | |
49 | pretag hook: t=fla n=4f92e785b90ae8995dfe156e39dd4fbc3b346a24 l=1 |
|
49 | pretag hook: t=fla n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 l=1 | |
50 | pretag.forbid hook |
|
50 | pretag.forbid hook | |
51 | abort: pretag.forbid hook exited with status 1 |
|
51 | abort: pretag.forbid hook exited with status 1 | |
52 | 4:4f92e785b90a |
|
52 | 4:8ea2ef7ad3e8 | |
53 | precommit hook: p1=4f92e785b90ae8995dfe156e39dd4fbc3b346a24 p2= |
|
53 | precommit hook: p1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p2= | |
54 | pretxncommit hook: n=7792358308a2026661cea44f9d47c072813004cb p1=4f92e785b90ae8995dfe156e39dd4fbc3b346a24 p2= |
|
54 | pretxncommit hook: n=fad284daf8c032148abaffcd745dafeceefceb61 p1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p2= | |
55 | 5:7792358308a2 |
|
55 | 5:fad284daf8c0 | |
56 |
pretxncommit.forbid hook: tip=5: |
|
56 | pretxncommit.forbid hook: tip=5:fad284daf8c0 | |
57 | abort: pretxncommit.forbid hook exited with status 1 |
|
57 | abort: pretxncommit.forbid hook exited with status 1 | |
58 | transaction abort! |
|
58 | transaction abort! | |
59 | rollback completed |
|
59 | rollback completed | |
60 | 4:4f92e785b90a |
|
60 | 4:8ea2ef7ad3e8 | |
61 | precommit hook: p1=4f92e785b90ae8995dfe156e39dd4fbc3b346a24 p2= |
|
61 | precommit hook: p1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p2= | |
62 | precommit.forbid hook |
|
62 | precommit.forbid hook | |
63 | abort: precommit.forbid hook exited with status 1 |
|
63 | abort: precommit.forbid hook exited with status 1 | |
64 | 4:4f92e785b90a |
|
64 | 4:8ea2ef7ad3e8 | |
65 | preupdate hook: p1=b702efe9688826e3a91283852b328b84dbf37bc2 p2= |
|
65 | preupdate hook: p1=b702efe9688826e3a91283852b328b84dbf37bc2 p2= | |
66 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
66 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
67 | preupdate hook: p1=4f92e785b90ae8995dfe156e39dd4fbc3b346a24 p2= |
|
67 | preupdate hook: p1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p2= | |
68 | update hook: p1=4f92e785b90ae8995dfe156e39dd4fbc3b346a24 p2= err=0 |
|
68 | update hook: p1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 p2= err=0 | |
69 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
69 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
70 | 3:4c52fb2e4022 |
|
70 | 3:4c52fb2e4022 | |
71 | prechangegroup.forbid hook |
|
71 | prechangegroup.forbid hook | |
72 | pulling from ../a |
|
72 | pulling from ../a | |
73 | searching for changes |
|
73 | searching for changes | |
74 | abort: prechangegroup.forbid hook exited with status 1 |
|
74 | abort: prechangegroup.forbid hook exited with status 1 | |
75 |
pretxnchangegroup.forbid hook: tip=4: |
|
75 | pretxnchangegroup.forbid hook: tip=4:8ea2ef7ad3e8 | |
76 | pulling from ../a |
|
76 | pulling from ../a | |
77 | searching for changes |
|
77 | searching for changes | |
78 | adding changesets |
|
78 | adding changesets | |
@@ -84,7 +84,7 b' transaction abort!' | |||||
84 | rollback completed |
|
84 | rollback completed | |
85 | 3:4c52fb2e4022 |
|
85 | 3:4c52fb2e4022 | |
86 | preoutgoing hook: s=pull |
|
86 | preoutgoing hook: s=pull | |
87 | outgoing hook: n=4f92e785b90ae8995dfe156e39dd4fbc3b346a24 s=pull |
|
87 | outgoing hook: n=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 s=pull | |
88 | pulling from ../a |
|
88 | pulling from ../a | |
89 | searching for changes |
|
89 | searching for changes | |
90 | adding changesets |
|
90 | adding changesets |
@@ -1,6 +1,6 b'' | |||||
1 | reverting a |
|
1 | reverting a | |
2 | changeset 3:107ce1ee2b43 backs out changeset 1:25a1420a55f8 |
|
2 | changeset 3:107ce1ee2b43 backs out changeset 1:25a1420a55f8 | |
3 |
merging with changeset 2: |
|
3 | merging with changeset 2:e6c3abc120e7 | |
4 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
4 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
5 | (branch merge, don't forget to commit) |
|
5 | (branch merge, don't forget to commit) | |
6 | abort: invalid date: 'should fail' |
|
6 | abort: invalid date: 'should fail' |
@@ -4,11 +4,11 b' user: test' | |||||
4 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
4 | date: Mon Jan 12 13:46:40 1970 +0000 | |
5 | summary: test |
|
5 | summary: test | |
6 |
|
6 | |||
7 |
changeset: 1: |
|
7 | changeset: 1:3ecf002a1c57 | |
8 | tag: tip |
|
8 | tag: tip | |
9 | user: test |
|
9 | user: test | |
10 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
10 | date: Mon Jan 12 13:46:40 1970 +0000 | |
11 |
summary: Added tag bleah for changeset 0acdaf898367 |
|
11 | summary: Added tag bleah for changeset 0acdaf898367 | |
12 |
|
12 | |||
13 | changeset: 0:0acdaf898367 |
|
13 | changeset: 0:0acdaf898367 | |
14 | tag: bleah |
|
14 | tag: bleah | |
@@ -24,9 +24,9 b' failed' | |||||
24 | use of 'hg tag NAME [REV]' is deprecated, please use 'hg tag [-r REV] NAME' instead |
|
24 | use of 'hg tag NAME [REV]' is deprecated, please use 'hg tag [-r REV] NAME' instead | |
25 | 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah |
|
25 | 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah | |
26 | 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah0 |
|
26 | 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah0 | |
27 | c5c60883086f5526bd3e36814b94a73a4e75e172 bleah1 |
|
27 | 3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1 | |
28 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
28 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
29 | 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar |
|
29 | 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar | |
30 | c5c60883086f5526bd3e36814b94a73a4e75e172 bleah1 |
|
30 | 3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1 | |
31 | abort: '\n' cannot be used in a tag name |
|
31 | abort: '\n' cannot be used in a tag name | |
32 | abort: ':' cannot be used in a tag name |
|
32 | abort: ':' cannot be used in a tag name |
@@ -16,21 +16,21 b' 1 files updated, 0 files merged, 0 files' | |||||
16 | (branch merge, don't forget to commit) |
|
16 | (branch merge, don't forget to commit) | |
17 | 8216907a933d+8a3ca90d111d+ tip |
|
17 | 8216907a933d+8a3ca90d111d+ tip | |
18 | M .hgtags |
|
18 | M .hgtags | |
19 |
tip 6: |
|
19 | tip 6:e2174d339386 | |
20 | first 0:0acdaf898367 |
|
20 | first 0:0acdaf898367 | |
21 |
.hgtags (rev 7: |
|
21 | .hgtags (rev 7:c071f74ab5eb), line 2: cannot parse entry | |
22 |
.hgtags (rev 7: |
|
22 | .hgtags (rev 7:c071f74ab5eb), line 4: node 'foo' is not well formed | |
23 | localtags, line 1: tag 'invalid' refers to unknown node |
|
23 | localtags, line 1: tag 'invalid' refers to unknown node | |
24 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
24 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
25 |
.hgtags (rev 7: |
|
25 | .hgtags (rev 7:c071f74ab5eb), line 2: cannot parse entry | |
26 |
.hgtags (rev 7: |
|
26 | .hgtags (rev 7:c071f74ab5eb), line 4: node 'foo' is not well formed | |
27 | .hgtags (rev 8:4ca6f1b1a68c), line 2: node 'x' is not well formed |
|
27 | .hgtags (rev 8:4ca6f1b1a68c), line 2: node 'x' is not well formed | |
28 | localtags, line 1: tag 'invalid' refers to unknown node |
|
28 | localtags, line 1: tag 'invalid' refers to unknown node | |
29 | tip 8:4ca6f1b1a68c |
|
29 | tip 8:4ca6f1b1a68c | |
30 | first 0:0acdaf898367 |
|
30 | first 0:0acdaf898367 | |
31 | changeset: 8:4ca6f1b1a68c |
|
31 | changeset: 8:4ca6f1b1a68c | |
32 |
.hgtags (rev 7: |
|
32 | .hgtags (rev 7:c071f74ab5eb), line 2: cannot parse entry | |
33 |
.hgtags (rev 7: |
|
33 | .hgtags (rev 7:c071f74ab5eb), line 4: node 'foo' is not well formed | |
34 | .hgtags (rev 8:4ca6f1b1a68c), line 2: node 'x' is not well formed |
|
34 | .hgtags (rev 8:4ca6f1b1a68c), line 2: node 'x' is not well formed | |
35 | localtags, line 1: tag 'invalid' refers to unknown node |
|
35 | localtags, line 1: tag 'invalid' refers to unknown node | |
36 | tag: tip |
|
36 | tag: tip |
General Comments 0
You need to be logged in to leave comments.
Login now