tests/test-tag.out
author Henrik Stuart <henrik.stuart@edlund.dk>
Sat, 23 May 2009 17:02:49 +0200
changeset 8562 e3495c399006
parent 8417 39cf453da958
child 11047 c7dbd6c4877a
permissions -rw-r--r--
named branches: server branchmap wire protocol support (issue736) The repository command, 'branchmap', returns a dictionary, branchname -> [branchheads], and will be implemented for localrepo, httprepo and sshrepo. The following wire format is used for returning data: branchname1 branch1head2 branch1head2 ... branchname2 ... ... Branch names are URL encoded to escape white space, and branch heads are sent as hex encoded node ids. All branches and all their heads are sent. The background and motivation for this command is the desire for a richer named branch semantics when pushing changesets. The details are explained in the original proposal which is included below. 1. BACKGROUND The algorithm currently implemented in Mercurial only considers the graph theoretical heads when determining whether new heads are created, rather than using the branch heads as a count (the algorithm considers a branch head effectively closed when it is merged into another branch or a new named branch is started from that point onward). Our particular problem with the algorithm is that we'd like to see the following case working without forcing a push: Upsteam has: (0:dev) ---- (1:dev) \ `--- (2:stable) Someone merges stable into dev: (0:dev) ---- (1:dev) ------(3:dev) \ / `--- (2:stable) --------´ This can be pushed without --force (as it should). Now someone else does some coding on stable (a bug fix, say): (0:dev) ---- (1:dev) ------(3:dev) \ / `--- (2:stable) ---------´---------(4:stable) This time we need --force to push. We allow this to be pushed without using --force by getting all the remote branch heads (by extending the wire protocol with a new function). We would, furthermore, also prefer if it is impossible to push a new branch without --force (or a later --newbranch option so --force isn't shoe-horned into too many disparate functions, if need be), except of course in the case where the remote repository is empty. This is what our patches accomplish. 2. ALTERNATIVES We have, of course, considered some alternatives to reconstructing enough information to decide whether we are creating new remote branch heads, before we added the new wire protocol command. 2.1. LOOKUP ON REMOTE The main alternative is to use the information from remote.heads() and remote.lookup() to try to reconstruct enough graph information to decide whether we are creating new heads. This is not adequate as illustrated below. Remember that each lookup is typically a request-response pair over SSH or HTTP(S). If we have a simple repository at the remote end like this: (0:dev) ---- (1:dev) ---- (3:stable) \ `--- (2:dev) then remote.heads() will yield [2, 3]. Assume we have nodes [0, 1, 2] locally and want to create a new node, 4:dev, as a descendant from (1:dev), which should be OK as 1:dev is a branch head. If we do remote.lookup('dev') we will get [2]. Thus, we can get information about whether a branch exists on the remote server or not, but this does not solve our problem of figuring out whether we are creating new heads or not. Pushing 4:dev ought to be OK, since after the push, we still only have two heads on branch a. Using remote.lookup() and remote.heads() is thus not adequate to consistently decide whether we are creating new remote heads (e.g. in this situation the latter would never return 1:dev). 2.2. USING INCOMING TO RECONSTRUCT THE GRAPH An alternative would be to use information equivalent to hg incoming to get the full remote graph in addition to the local graph. To do this, we would have to get a changegroup(subset) bundle representing the remote end (which may be a substantial amount of data), getting the branch heads from an instantiated bundlerepository, deleting the bundle, and finally, we can compute the prepush logic. While this is backwards compatible, it will cause a possibly substantial slowdown of the push command as it first needs to pull in all changes. 3. FURTHER ARGUMENTS IN FAVOUR OF THE BRANCHMAP WIRE-PROTOCOL EXTENSION Currently, the commands incoming and pull, work based on the tip of a given branch if used with "-r branchname", making it hard to get all revisions of a certain branch only (if it has multiple heads). This can be solved by requesting the remote's branchheads and letting the revisions to be used with the command be these heads. This can be done by extending the commands with a new option, e.g.: hg pull -b branchname which will be turned into the equivalent of: hg pull -r branchhead1 -r branchhead2 -r branchhead3 We have a simple follow-up patch that can do this ready as well (although not submitted yet as it is pending the acceptance of the branch patch). 4. WRAP-UP We generally find that the branchmap wire protocol extension can provide better named branch support to Mercurial. Currently, some things, like the initial push scenario in this mail, are fairly counter-intuitive, and the more often you have to force push, the more it is likely you will get a lot of spurious and unnecessary merge nodes. Also, restricting incoming and pull to all changes on a branch rather than changes on the tip-most head would be a sensible extension to making named branches a first class citizen in Mercurial. Currently, named branches sometimes feel like a late-coming unwanted step-child. We have run it in a production environment for a while, with fewer multiple heads occurring in our repositories and fewer confused users as a result. Also, it fixes the long-standing issue 736. Co-contributor: Sune Foldager <cryo@cyanite.org>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1662
diff changeset
     1
changeset:   0:0acdaf898367
401
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
     2
tag:         tip
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
     3
user:        test
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1662
diff changeset
     4
date:        Mon Jan 12 13:46:40 1970 +0000
401
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
     5
summary:     test
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
     6
2967
eef469259745 tag: shorten hash in default commit message
Matt Mackall <mpm@selenic.com>
parents: 2647
diff changeset
     7
changeset:   1:3ecf002a1c57
401
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
     8
tag:         tip
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
     9
user:        test
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1662
diff changeset
    10
date:        Mon Jan 12 13:46:40 1970 +0000
2967
eef469259745 tag: shorten hash in default commit message
Matt Mackall <mpm@selenic.com>
parents: 2647
diff changeset
    11
summary:     Added tag bleah for changeset 0acdaf898367
401
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
    12
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1662
diff changeset
    13
changeset:   0:0acdaf898367
401
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
    14
tag:         bleah
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
    15
user:        test
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1662
diff changeset
    16
date:        Mon Jan 12 13:46:40 1970 +0000
401
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
    17
summary:     test
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
    18
1235
5c0bd13bd771 Fix test-tag output for new abort message
mpm@selenic.com
parents: 1234
diff changeset
    19
abort: working copy of .hgtags is changed (please commit .hgtags manually)
401
af4848f83e68 From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl>
mpm@selenic.com
parents:
diff changeset
    20
failed
6321
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    21
abort: tag names must be unique
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    22
failed
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    23
abort: the name 'tip' is reserved
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    24
failed
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    25
abort: tag 'bleah' already exists (use -f to force)
1654
b7fc961507db deprecate the use of 'hg tag NAME [REV]'
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1596
diff changeset
    26
failed
6321
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    27
abort: tag 'bleah' already exists (use -f to force)
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    28
failed
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    29
abort: tag 'blecch' does not exist
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    30
failed
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    31
abort: tag 'blecch' does not exist
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    32
failed
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1662
diff changeset
    33
0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1662
diff changeset
    34
0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah0
6321
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    35
868cc8fbb43b754ad09fa109885d243fc49adae7 gack
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    36
868cc8fbb43b754ad09fa109885d243fc49adae7 gawk
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    37
868cc8fbb43b754ad09fa109885d243fc49adae7 gorp
7814
4421abf8c85d tag: force load of tag cache
Matt Mackall <mpm@selenic.com>
parents: 6671
diff changeset
    38
868cc8fbb43b754ad09fa109885d243fc49adae7 gack
6321
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    39
3807bcf62c5614cb6c16436b514d7764ca5f1631 gack
6671
938eddd76237 tag: record tag we're superseding, if any (issue 1102)
Matt Mackall <mpm@selenic.com>
parents: 6321
diff changeset
    40
3807bcf62c5614cb6c16436b514d7764ca5f1631 gack
6321
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    41
0000000000000000000000000000000000000000 gack
6671
938eddd76237 tag: record tag we're superseding, if any (issue 1102)
Matt Mackall <mpm@selenic.com>
parents: 6321
diff changeset
    42
868cc8fbb43b754ad09fa109885d243fc49adae7 gorp
6321
55ba3bc5b8fd tag: allow multiple tags to be added or removed
John Coomes <john.coomes@sun.com>
parents: 4892
diff changeset
    43
0000000000000000000000000000000000000000 gorp
2967
eef469259745 tag: shorten hash in default commit message
Matt Mackall <mpm@selenic.com>
parents: 2647
diff changeset
    44
3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
2647
46182568b4ce change 'hg tag' to tag the parent rev instead of tip
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2036
diff changeset
    45
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
46182568b4ce change 'hg tag' to tag the parent rev instead of tip
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2036
diff changeset
    46
0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar
2967
eef469259745 tag: shorten hash in default commit message
Matt Mackall <mpm@selenic.com>
parents: 2647
diff changeset
    47
3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
1561
9c6d0abdb94e disallow '\n' and '\r' in tag names
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1235
diff changeset
    48
abort: '\n' cannot be used in a tag name
9c6d0abdb94e disallow '\n' and '\r' in tag names
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1235
diff changeset
    49
abort: ':' cannot be used in a tag name
8417
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    50
% cloning local tags
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    51
changeset:   0:0acdaf898367
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    52
tag:         foobar
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    53
tag:         bleah
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    54
tag:         bleah0
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    55
user:        test
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    56
date:        Mon Jan 12 13:46:40 1970 +0000
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    57
summary:     test
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    58
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    59
changeset:   1:3ecf002a1c57
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    60
tag:         bleah1
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    61
user:        test
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    62
date:        Mon Jan 12 13:46:40 1970 +0000
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    63
summary:     Added tag bleah for changeset 0acdaf898367
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    64
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    65
changeset:   2:868cc8fbb43b
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    66
tag:         gawk
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    67
user:        test
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    68
date:        Mon Jan 12 13:46:40 1970 +0000
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    69
summary:     Added tag bleah0 for changeset 0acdaf898367
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    70
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    71
changeset:   3:3807bcf62c56
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    72
user:        test
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    73
date:        Mon Jan 12 13:46:40 1970 +0000
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    74
summary:     Added tag gack, gawk, gorp for changeset 868cc8fbb43b
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    75
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    76
changeset:   4:140c6e8597b4
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    77
user:        test
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    78
date:        Mon Jan 12 13:46:40 1970 +0000
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    79
summary:     Added tag gack for changeset 3807bcf62c56
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    80
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    81
changeset:   5:470a65fa7cc9
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    82
user:        test
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    83
date:        Mon Jan 12 13:46:40 1970 +0000
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    84
summary:     Removed tag gack, gorp
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    85
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    86
1[tip]   3ecf002a1c57   1970-01-12 13:46 +0000   test
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    87
  Added tag bleah for changeset 0acdaf898367
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    88
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    89
5[tip]   470a65fa7cc9   1970-01-12 13:46 +0000   test
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    90
  Removed tag gack, gorp
39cf453da958 clone: try updating to the actual changeset specified in options
Brett Carter <brett@rdnzl.net>
parents: 7814
diff changeset
    91
4892
d69b1fb111b9 tag: handle .hgtags and .hg/localtags with missing final newline (issue 601)
Bryan O'Sullivan <bos@serpentine.com>
parents: 2967
diff changeset
    92
% issue 601
d69b1fb111b9 tag: handle .hgtags and .hg/localtags with missing final newline (issue 601)
Bryan O'Sullivan <bos@serpentine.com>
parents: 2967
diff changeset
    93
3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah13ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
d69b1fb111b9 tag: handle .hgtags and .hg/localtags with missing final newline (issue 601)
Bryan O'Sullivan <bos@serpentine.com>
parents: 2967
diff changeset
    94
f68b039e72eacbb2e68b0543e1f6e50990aa2bb5 localnewline
d69b1fb111b9 tag: handle .hgtags and .hg/localtags with missing final newline (issue 601)
Bryan O'Sullivan <bos@serpentine.com>
parents: 2967
diff changeset
    95
0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar
d69b1fb111b9 tag: handle .hgtags and .hg/localtags with missing final newline (issue 601)
Bryan O'Sullivan <bos@serpentine.com>
parents: 2967
diff changeset
    96
6ae703d793c8b1f097116869275ecd97b2977a2b newline