tests/test-update-branches.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Wed, 24 Feb 2016 23:00:33 +0900
changeset 28266 de8b09482fb7
parent 28065 6b1fc09c699a
child 28385 3f9e25a42e69
permissions -rw-r--r--
destutil: show message about other branch heads, even if on a closed head Before this patch, bare "hg update" displays message below, if there is at least one non-closed branch head other than current parent: 1. 'XX other heads for branch "BRANCH"' message, if current parent is on a non-closed branch head This suggests user to invoke "hg heads" or so for merging them. 2. no message, if current parent is on a closed branch head At this patch, bare "hg update" might choose closed branch head as update destination, and it causes this situation easily. 3. no message, otherwise (= current parent isn't on any branch head) 'XX other heads for branch "BRANCH"' should be displayed also in #2 case above, because user might overlook other non-closed branch heads. This patch gets a list of all branch heads regardless of closed-ness of it, and uses it (= 'allheads') to distinguish #1/#2 from #3 above.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9716
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
     1
# Construct the following history tree:
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
     2
#
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
     3
# @  5:e1bb631146ca  b1
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
     4
# |
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
     5
# o  4:a4fdb3b883c4 0:b608b9236435  b1
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
     6
# |
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
     7
# | o  3:4b57d2520816 1:44592833ba9f
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
     8
# | |
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
     9
# | | o  2:063f31070f65
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
    10
# | |/
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
    11
# | o  1:44592833ba9f
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
    12
# |/
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
    13
# o  0:b608b9236435
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
    14
17773
434e5bd615fc commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents: 17347
diff changeset
    15
  $ mkdir b1
434e5bd615fc commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents: 17347
diff changeset
    16
  $ cd b1
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    17
  $ hg init
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    18
  $ echo foo > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    19
  $ echo zero > a
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    20
  $ hg init sub
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    21
  $ echo suba > sub/suba
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    22
  $ hg --cwd sub ci -Am addsuba
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    23
  adding suba
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    24
  $ echo 'sub = sub' > .hgsub
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    25
  $ hg ci -qAm0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    26
  $ echo one > a ; hg ci -m1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    27
  $ echo two > a ; hg ci -m2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    28
  $ hg up -q 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    29
  $ echo three > a ; hg ci -qm3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    30
  $ hg up -q 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    31
  $ hg branch -q b1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    32
  $ echo four > a ; hg ci -qm4
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    33
  $ echo five > a ; hg ci -qm5
9716
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
    34
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    35
Initial repo state:
9716
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
    36
20117
aa9385f983fa tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents: 20107
diff changeset
    37
  $ hg log -G --template '{rev}:{node|short} {parents} {branches}\n'
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    38
  @  5:ff252e8273df  b1
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    39
  |
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    40
  o  4:d047485b3896 0:60829823a42a  b1
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    41
  |
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    42
  | o  3:6efa171f091b 1:0786582aa4b1
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    43
  | |
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    44
  | | o  2:bd10386d478c
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    45
  | |/
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    46
  | o  1:0786582aa4b1
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    47
  |/
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    48
  o  0:60829823a42a
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    49
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    50
17773
434e5bd615fc commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents: 17347
diff changeset
    51
Make sure update doesn't assume b1 is a repository if invoked from outside:
434e5bd615fc commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents: 17347
diff changeset
    52
434e5bd615fc commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents: 17347
diff changeset
    53
  $ cd ..
434e5bd615fc commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents: 17347
diff changeset
    54
  $ hg update b1
434e5bd615fc commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents: 17347
diff changeset
    55
  abort: no repository found in '$TESTTMP' (.hg not found)!
434e5bd615fc commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents: 17347
diff changeset
    56
  [255]
434e5bd615fc commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents: 17347
diff changeset
    57
  $ cd b1
434e5bd615fc commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents: 17347
diff changeset
    58
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    59
Test helper functions:
9716
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
    60
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    61
  $ revtest () {
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    62
  >     msg=$1
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    63
  >     dirtyflag=$2   # 'clean', 'dirty' or 'dirtysub'
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    64
  >     startrev=$3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    65
  >     targetrev=$4
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    66
  >     opt=$5
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    67
  >     hg up -qC $startrev
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    68
  >     test $dirtyflag = dirty && echo dirty > foo
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    69
  >     test $dirtyflag = dirtysub && echo dirty > sub/suba
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    70
  >     hg up $opt $targetrev
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    71
  >     hg parent --template 'parent={rev}\n'
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    72
  >     hg stat -S
17347
2da47de36b6f check-code: fix check for trailing whitespace on continued lines too
Mads Kiilerich <mads@kiilerich.com>
parents: 16491
diff changeset
    73
  > }
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    74
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    75
  $ norevtest () {
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    76
  >     msg=$1
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    77
  >     dirtyflag=$2   # 'clean', 'dirty' or 'dirtysub'
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    78
  >     startrev=$3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    79
  >     opt=$4
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    80
  >     hg up -qC $startrev
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    81
  >     test $dirtyflag = dirty && echo dirty > foo
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    82
  >     test $dirtyflag = dirtysub && echo dirty > sub/suba
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    83
  >     hg up $opt
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    84
  >     hg parent --template 'parent={rev}\n'
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
    85
  >     hg stat -S
17347
2da47de36b6f check-code: fix check for trailing whitespace on continued lines too
Mads Kiilerich <mads@kiilerich.com>
parents: 16491
diff changeset
    86
  > }
9716
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
    87
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
    88
Test cases are documented in a table in the update function of merge.py.
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
    89
Cases are run as shown in that table, row by row.
9716
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
    90
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    91
  $ norevtest 'none clean linear' clean 4
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    92
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    93
  parent=5
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    94
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    95
  $ norevtest 'none clean same'   clean 2
28065
6b1fc09c699a update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28029
diff changeset
    96
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
6b1fc09c699a update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28029
diff changeset
    97
  1 other heads for branch "default"
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    98
  parent=2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
    99
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   100
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   101
  $ revtest 'none clean linear' clean 1 2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   102
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   103
  parent=2
9716
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
   104
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   105
  $ revtest 'none clean same'   clean 2 3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   106
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   107
  parent=3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   108
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   109
  $ revtest 'none clean cross'  clean 3 4
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   110
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   111
  parent=4
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   112
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   113
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   114
  $ revtest 'none dirty linear' dirty 1 2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   115
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   116
  parent=2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   117
  M foo
9716
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
   118
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   119
  $ revtest 'none dirtysub linear' dirtysub 1 2
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   120
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   121
  parent=2
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   122
  M sub/suba
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   123
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   124
  $ revtest 'none dirty same'   dirty 2 3
19799
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
   125
  abort: uncommitted changes
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
   126
  (commit or update --clean to discard changes)
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   127
  parent=2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   128
  M foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   129
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   130
  $ revtest 'none dirtysub same'   dirtysub 2 3
19799
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
   131
  abort: uncommitted changes
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
   132
  (commit or update --clean to discard changes)
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   133
  parent=2
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   134
  M sub/suba
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   135
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   136
  $ revtest 'none dirty cross'  dirty 3 4
19799
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
   137
  abort: uncommitted changes
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
   138
  (commit or update --clean to discard changes)
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   139
  parent=3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   140
  M foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   141
19800
4894e0d9462d update: improve error message for dirty non-linear update with rev
Siddharth Agarwal <sid0@fb.com>
parents: 19799
diff changeset
   142
  $ norevtest 'none dirty cross'  dirty 2
28065
6b1fc09c699a update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28029
diff changeset
   143
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
6b1fc09c699a update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28029
diff changeset
   144
  1 other heads for branch "default"
19800
4894e0d9462d update: improve error message for dirty non-linear update with rev
Siddharth Agarwal <sid0@fb.com>
parents: 19799
diff changeset
   145
  parent=2
4894e0d9462d update: improve error message for dirty non-linear update with rev
Siddharth Agarwal <sid0@fb.com>
parents: 19799
diff changeset
   146
  M foo
4894e0d9462d update: improve error message for dirty non-linear update with rev
Siddharth Agarwal <sid0@fb.com>
parents: 19799
diff changeset
   147
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   148
  $ revtest 'none dirtysub cross'  dirtysub 3 4
19799
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
   149
  abort: uncommitted changes
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
   150
  (commit or update --clean to discard changes)
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   151
  parent=3
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   152
  M sub/suba
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   153
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   154
  $ revtest '-C dirty linear'   dirty 1 2 -C
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   155
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   156
  parent=2
9716
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
   157
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   158
  $ revtest '-c dirty linear'   dirty 1 2 -c
19801
41abe2e3e3b7 update: standardize error message for dirty update --check
Siddharth Agarwal <sid0@fb.com>
parents: 19800
diff changeset
   159
  abort: uncommitted changes
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   160
  parent=1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   161
  M foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   162
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   163
  $ revtest '-c dirtysub linear'   dirtysub 1 2 -c
24473
0142b59f5743 update: replace workingctx.dirty and raising Abort by cmdutil.bailifchanged
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22955
diff changeset
   164
  abort: uncommitted changes in subrepository 'sub'
16491
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   165
  parent=1
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   166
  M sub/suba
bfe89d65d651 update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents: 14485
diff changeset
   167
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   168
  $ norevtest '-c clean same'   clean 2 -c
28065
6b1fc09c699a update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28029
diff changeset
   169
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
28029
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26713
diff changeset
   170
  1 other heads for branch "default"
28065
6b1fc09c699a update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28029
diff changeset
   171
  parent=2
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   172
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   173
  $ revtest '-cC dirty linear'  dirty 1 2 -cC
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   174
  abort: cannot specify both -c/--check and -C/--clean
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   175
  parent=1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   176
  M foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 9716
diff changeset
   177
28266
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   178
  $ cd ..
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   179
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   180
Test updating with closed head
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   181
---------------------------------------------------------------------
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   182
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   183
  $ hg clone -U -q b1 closed-heads
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   184
  $ cd closed-heads
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   185
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   186
Test updating if at least one non-closed branch head exists
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   187
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   188
if on the closed branch head:
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   189
- updating is no-op
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   190
- "N other heads for ...." message is displayed
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   191
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   192
  $ hg update -q -C 3
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   193
  $ hg commit --close-branch -m 6
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   194
  $ norevtest "on closed branch head" clean 6
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   195
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   196
  1 other heads for branch "default"
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   197
  parent=6
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   198
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   199
Test updating if all branch heads are closed
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   200
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   201
if on the closed branch head:
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   202
- updating is no-op
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   203
- "N other heads for ...." message isn't displayed
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   204
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   205
  $ hg update -q -C 2
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   206
  $ hg commit --close-branch -m 7
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   207
  $ norevtest "all heads of branch default are closed" clean 6
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   208
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   209
  parent=6
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   210
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   211
  $ cd ../b1
de8b09482fb7 destutil: show message about other branch heads, even if on a closed head
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   212
18985
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   213
Test obsolescence behavior
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   214
---------------------------------------------------------------------
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   215
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   216
successors should be taken in account when checking head destination
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   217
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   218
  $ cat << EOF >> $HGRCPATH
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   219
  > [ui]
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   220
  > logtemplate={rev}:{node|short} {desc|firstline}
22955
fab9dda0f2a3 obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents: 20281
diff changeset
   221
  > [experimental]
fab9dda0f2a3 obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents: 20281
diff changeset
   222
  > evolution=createmarkers
18985
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   223
  > EOF
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   224
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   225
Test no-argument update to a successor of an obsoleted changeset
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   226
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   227
  $ hg log -G
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   228
  o  5:ff252e8273df 5
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   229
  |
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   230
  o  4:d047485b3896 4
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   231
  |
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   232
  | o  3:6efa171f091b 3
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   233
  | |
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   234
  | | o  2:bd10386d478c 2
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   235
  | |/
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   236
  | @  1:0786582aa4b1 1
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   237
  |/
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   238
  o  0:60829823a42a 0
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   239
  
20107
2ca325ea57fa bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents: 19801
diff changeset
   240
  $ hg book bm -r 3
18985
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   241
  $ hg status
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   242
  M foo
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   243
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   244
We add simple obsolescence marker between 3 and 4 (indirect successors)
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   245
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   246
  $ hg id --debug -i -r 3
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   247
  6efa171f091b00a3c35edc15d48c52a498929953
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   248
  $ hg id --debug -i -r 4
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   249
  d047485b3896813b2a624e86201983520f003206
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   250
  $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   251
  $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   252
20107
2ca325ea57fa bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents: 19801
diff changeset
   253
Test that 5 is detected as a valid destination from 3 and also accepts moving
2ca325ea57fa bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents: 19801
diff changeset
   254
the bookmark (issue4015)
2ca325ea57fa bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents: 19801
diff changeset
   255
18985
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   256
  $ hg up --quiet --hidden 3
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   257
  $ hg up 5
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   258
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20107
2ca325ea57fa bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents: 19801
diff changeset
   259
  $ hg book bm
2ca325ea57fa bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents: 19801
diff changeset
   260
  moving bookmark 'bm' forward from 6efa171f091b
2ca325ea57fa bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents: 19801
diff changeset
   261
  $ hg bookmarks
2ca325ea57fa bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents: 19801
diff changeset
   262
   * bm                        5:ff252e8273df
18985
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   263
20281
67ee87a371b2 update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents: 20280
diff changeset
   264
Test that 4 is detected as the no-argument destination from 3 and also moves
67ee87a371b2 update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents: 20280
diff changeset
   265
the bookmark with it
20280
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   266
  $ hg up --quiet 0          # we should be able to update to 3 directly
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   267
  $ hg up --quiet --hidden 3 # but not implemented yet.
20281
67ee87a371b2 update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents: 20280
diff changeset
   268
  $ hg book -f bm
20280
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   269
  $ hg up
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   270
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20281
67ee87a371b2 update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents: 20280
diff changeset
   271
  updating bookmark bm
67ee87a371b2 update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents: 20280
diff changeset
   272
  $ hg book
67ee87a371b2 update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents: 20280
diff changeset
   273
   * bm                        4:d047485b3896
20280
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   274
18985
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   275
Test that 5 is detected as a valid destination from 1
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   276
  $ hg up --quiet 0          # we should be able to update to 3 directly
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   277
  $ hg up --quiet --hidden 3 # but not implemented yet.
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   278
  $ hg up 5
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   279
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   280
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   281
Test that 5 is not detected as a valid destination from 2
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   282
  $ hg up --quiet 0
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   283
  $ hg up --quiet 2
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   284
  $ hg up 5
19799
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
   285
  abort: uncommitted changes
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
   286
  (commit or update --clean to discard changes)
18985
a59e575c6ff8 update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17773
diff changeset
   287
  [255]
20280
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   288
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   289
Test that we don't crash when updating from a pruned changeset (i.e. has no
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   290
successors). Behavior should probably be that we update to the first
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   291
non-obsolete parent but that will be decided later.
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   292
  $ hg id --debug -r 2
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   293
  bd10386d478cd5a9faf2e604114c8e6da62d3889
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   294
  $ hg up --quiet 0
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   295
  $ hg up --quiet 2
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   296
  $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   297
  $ hg up
95b9c6149e17 merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents: 20117
diff changeset
   298
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
26713
a271925699d6 revset: reintroduce and experimental revset for update destination
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24473
diff changeset
   299
a271925699d6 revset: reintroduce and experimental revset for update destination
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24473
diff changeset
   300
Test experimental revset support
a271925699d6 revset: reintroduce and experimental revset for update destination
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24473
diff changeset
   301
a271925699d6 revset: reintroduce and experimental revset for update destination
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24473
diff changeset
   302
  $ hg log -r '_destupdate()'
a271925699d6 revset: reintroduce and experimental revset for update destination
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24473
diff changeset
   303
  2:bd10386d478c 2 (no-eol)