tests/test-merge7.out
author Henrik Stuart <henrik.stuart@edlund.dk>
Sat, 23 May 2009 17:02:49 +0200
changeset 8562 e3495c399006
parent 7821 9fe7e6acf525
child 8753 af5f099d932b
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:
6338
0750f11152fe clone: print "updating working directory" status message
Adrian Buehlmann <adrian@cadifra.com>
parents: 6004
diff changeset
     1
updating working directory
2175
b2ae81a7df29 Make hg update more verbose by default (issue12)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2019
diff changeset
     2
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1352
bf6c91cb816f Make test-merge7 repeatable
Matt Mackall <mpm@selenic.com>
parents: 1351
diff changeset
     3
pulling from ../test-a
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     4
searching for changes
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     5
adding changesets
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     6
adding manifests
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     7
adding file changes
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     8
added 1 changesets with 1 changes to 1 files (+1 heads)
2019
ced2d3620f95 add merge command. means same thing as "update -m".
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
     9
(run 'hg heads' to see heads, 'hg merge' to merge)
6004
5af5f0f9d724 merge: allow smarter tool configuration
Matt Mackall <mpm@selenic.com>
parents: 5371
diff changeset
    10
merging test.txt
4365
46280c004f22 change tests to use simplemerge by default
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3314
diff changeset
    11
warning: conflicts during merge.
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    12
merging test.txt failed!
2175
b2ae81a7df29 Make hg update more verbose by default (issue12)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2019
diff changeset
    13
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
7821
9fe7e6acf525 merge: better error messages to lead users to hg update --clean to abandon merges.
Augie Fackler <durin42@gmail.com>
parents: 6518
diff changeset
    14
use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon
1352
bf6c91cb816f Make test-merge7 repeatable
Matt Mackall <mpm@selenic.com>
parents: 1351
diff changeset
    15
pulling from ../test-a
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    16
searching for changes
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    17
adding changesets
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    18
adding manifests
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    19
adding file changes
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    20
added 1 changesets with 1 changes to 1 files (+1 heads)
2019
ced2d3620f95 add merge command. means same thing as "update -m".
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    21
(run 'hg heads' to see heads, 'hg merge' to merge)
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    22
resolving manifests
3314
b16456909a0a merge: various tidying
Matt Mackall <mpm@selenic.com>
parents: 3311
diff changeset
    23
 overwrite None partial False
b16456909a0a merge: various tidying
Matt Mackall <mpm@selenic.com>
parents: 3311
diff changeset
    24
 ancestor faaea63e63a9 local 451c744aabcc+ remote a070d41e8360
5371
17ed9b9a0d03 merge: add debug diagnostics for findcopies
Matt Mackall <mpm@selenic.com>
parents: 4387
diff changeset
    25
  searching for copies back to rev 1
3121
2ef0b3aae186 merge: simplify actions with helper function
Matt Mackall <mpm@selenic.com>
parents: 3110
diff changeset
    26
 test.txt: versions differ -> m
6512
368a4ec603cc merge: introduce mergestate
Matt Mackall <mpm@selenic.com>
parents: 6338
diff changeset
    27
preserving test.txt for resolve of test.txt
6004
5af5f0f9d724 merge: allow smarter tool configuration
Matt Mackall <mpm@selenic.com>
parents: 5371
diff changeset
    28
picked tool 'internal:merge' for test.txt (binary False symlink False)
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    29
merging test.txt
3314
b16456909a0a merge: various tidying
Matt Mackall <mpm@selenic.com>
parents: 3311
diff changeset
    30
my test.txt@451c744aabcc+ other test.txt@a070d41e8360 ancestor test.txt@faaea63e63a9
6004
5af5f0f9d724 merge: allow smarter tool configuration
Matt Mackall <mpm@selenic.com>
parents: 5371
diff changeset
    31
warning: conflicts during merge.
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    32
merging test.txt failed!
1922
6d50d6189269 ui: output the number of file updated/merged/removed/... on update
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1352
diff changeset
    33
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
7821
9fe7e6acf525 merge: better error messages to lead users to hg update --clean to abandon merges.
Augie Fackler <durin42@gmail.com>
parents: 6518
diff changeset
    34
use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    35
one
6004
5af5f0f9d724 merge: allow smarter tool configuration
Matt Mackall <mpm@selenic.com>
parents: 5371
diff changeset
    36
<<<<<<< local
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    37
two-point-five
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    38
=======
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    39
two-point-one
4387
93a4e72b4f83 run-tests.py: pass -L/--label to simplemerge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4365
diff changeset
    40
>>>>>>> other
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    41
three
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    42
   rev    offset  length   base linkrev nodeid       p1           p2
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    43
     0         0       7      0       0 01365c4cca56 000000000000 000000000000
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    44
     1         7       9      1       1 7b013192566a 01365c4cca56 000000000000
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    45
     2        16      15      2       2 8fe46a3eb557 01365c4cca56 000000000000
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    46
     3        31      27      2       3 fc3148072371 7b013192566a 8fe46a3eb557
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    47
     4        58      25      4       4 d40249267ae3 8fe46a3eb557 000000000000
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1922
diff changeset
    48
changeset:   4:a070d41e8360
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    49
tag:         tip
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1922
diff changeset
    50
parent:      2:faaea63e63a9
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    51
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: 1922
diff changeset
    52
date:        Mon Jan 12 13:46:40 1970 +0000
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    53
summary:     two -> two-point-one
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    54
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1922
diff changeset
    55
changeset:   3:451c744aabcc
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1922
diff changeset
    56
parent:      1:e409be6afcc0
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1922
diff changeset
    57
parent:      2:faaea63e63a9
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    58
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: 1922
diff changeset
    59
date:        Mon Jan 12 13:46:40 1970 +0000
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    60
summary:     Merge 1
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    61
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1922
diff changeset
    62
changeset:   2:faaea63e63a9
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1922
diff changeset
    63
parent:      0:095c92b91f1a
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    64
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: 1922
diff changeset
    65
date:        Mon Jan 12 13:46:40 1970 +0000
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    66
summary:     Numbers as words
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    67
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1922
diff changeset
    68
changeset:   1:e409be6afcc0
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    69
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: 1922
diff changeset
    70
date:        Mon Jan 12 13:46:40 1970 +0000
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    71
summary:     2 -> 2.5
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    72
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1922
diff changeset
    73
changeset:   0:095c92b91f1a
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    74
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: 1922
diff changeset
    75
date:        Mon Jan 12 13:46:40 1970 +0000
1351
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    76
summary:     Initial
0e2be889ccd7 Repair ancestor logic, fix up test cases
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    77