tests/test-rebase-bookmarks.t
author Mark Thomas <mbthomas@fb.com>
Mon, 02 Oct 2017 14:05:30 -0700
changeset 34543 6fad8059a970
parent 34367 f61f5af5ed31
child 35385 469b06b4c3ca
permissions -rw-r--r--
scmutil: handle conflicting files and dirs in origbackuppath When ui.origbackuppath is set, .orig files are stored outside of the working copy. However conflicts can occur when files or directories end up having the same name. These conflicts cause Mercurial to abort, even if they've been created as a result of different backups. Make sure we always replace files or directories in the origbackuppath if they conflict with another file or directory. Test Plan: Add new unit test for conflicting paths. Differential Revision: https://phab.mercurial-scm.org/D680
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     2
  > [extensions]
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     3
  > rebase=
34354
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
     4
  > drawdag=$TESTDIR/drawdag.py
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     5
  > 
15742
65df60a3f96b phases: prevent rebase to rebase immutable changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 14884
diff changeset
     6
  > [phases]
65df60a3f96b phases: prevent rebase to rebase immutable changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 14884
diff changeset
     7
  > publish=False
65df60a3f96b phases: prevent rebase to rebase immutable changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 14884
diff changeset
     8
  > 
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     9
  > [alias]
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    10
  > tglog = log -G --template "{rev}: '{desc}' bookmarks: {bookmarks}\n"
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    11
  > EOF
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    12
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    13
Create a repo with several bookmarks
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    14
  $ hg init a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    15
  $ cd a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    16
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    17
  $ echo a > a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    18
  $ hg ci -Am A
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    19
  adding a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    20
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    21
  $ echo b > b
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    22
  $ hg ci -Am B
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    23
  adding b
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    24
  $ hg book 'X'
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    25
  $ hg book 'Y'
17346
2944a6d35158 check-code: fix check for trailing whitespace on empty lines
Mads Kiilerich <mads@kiilerich.com>
parents: 17345
diff changeset
    26
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    27
  $ echo c > c
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    28
  $ hg ci -Am C
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    29
  adding c
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    30
  $ hg book 'Z'
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    31
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    32
  $ hg up -q 0
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    33
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    34
  $ echo d > d
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    35
  $ hg ci -Am D
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    36
  adding d
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    37
  created new head
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    38
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
    39
  $ hg book W
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
    40
17345
4f8054d3171b check-code: fix check for trailing whitespace on sh command lines
Mads Kiilerich <mads@kiilerich.com>
parents: 17059
diff changeset
    41
  $ hg tglog
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
    42
  @  3: 'D' bookmarks: W
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    43
  |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    44
  | o  2: 'C' bookmarks: Y Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    45
  | |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    46
  | o  1: 'B' bookmarks: X
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    47
  |/
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    48
  o  0: 'A' bookmarks:
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    49
  
17346
2944a6d35158 check-code: fix check for trailing whitespace on empty lines
Mads Kiilerich <mads@kiilerich.com>
parents: 17345
diff changeset
    50
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    51
Move only rebased bookmarks
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    52
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    53
  $ cd ..
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    54
  $ hg clone -q a a1
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    55
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    56
  $ cd a1
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    57
  $ hg up -q Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    58
18514
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    59
Test deleting divergent bookmarks from dest (issue3685)
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    60
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    61
  $ hg book -r 3 Z@diverge
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    62
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    63
... and also test that bookmarks not on dest or not being moved aren't deleted
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    64
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    65
  $ hg book -r 3 X@diverge
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    66
  $ hg book -r 0 Y@diverge
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    67
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    68
  $ hg tglog
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    69
  o  3: 'D' bookmarks: W X@diverge Z@diverge
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    70
  |
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    71
  | @  2: 'C' bookmarks: Y Z
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    72
  | |
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    73
  | o  1: 'B' bookmarks: X
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    74
  |/
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    75
  o  0: 'A' bookmarks: Y@diverge
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    76
  
17005
50f434510da6 rebase: do not add second parent to rebased changeset (drop detach option) (BC)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 16913
diff changeset
    77
  $ hg rebase -s Y -d 3
23517
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
    78
  rebasing 2:49cb3485fa0c "C" (Y Z)
33332
3b7cb3d17137 rebase: use scmutil.cleanupnodes (issue5606) (BC)
Jun Wu <quark@fb.com>
parents: 28101
diff changeset
    79
  saved backup bundle to $TESTTMP/a1/.hg/strip-backup/49cb3485fa0c-126f3e97-rebase.hg (glob)
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    80
17345
4f8054d3171b check-code: fix check for trailing whitespace on sh command lines
Mads Kiilerich <mads@kiilerich.com>
parents: 17059
diff changeset
    81
  $ hg tglog
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    82
  @  3: 'C' bookmarks: Y Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    83
  |
18514
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    84
  o  2: 'D' bookmarks: W X@diverge
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    85
  |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    86
  | o  1: 'B' bookmarks: X
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    87
  |/
18514
2a1fac3650a5 rebase: delete divergent bookmarks on destination (issue3685)
Siddharth Agarwal <sid0@fb.com>
parents: 17346
diff changeset
    88
  o  0: 'A' bookmarks: Y@diverge
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    89
  
20523
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
    90
Do not try to keep active but deleted divergent bookmark
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
    91
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
    92
  $ cd ..
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
    93
  $ hg clone -q a a4
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
    94
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
    95
  $ cd a4
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
    96
  $ hg up -q 2
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
    97
  $ hg book W@diverge
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
    98
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
    99
  $ hg rebase -s W -d .
34290
4f969b9e0cf5 rebase: also include other namespaces in changeset description
Martin von Zweigbergk <martinvonz@google.com>
parents: 33332
diff changeset
   100
  rebasing 3:41acb9dca9eb "D" (W tip)
33332
3b7cb3d17137 rebase: use scmutil.cleanupnodes (issue5606) (BC)
Jun Wu <quark@fb.com>
parents: 28101
diff changeset
   101
  saved backup bundle to $TESTTMP/a4/.hg/strip-backup/41acb9dca9eb-b35a6a63-rebase.hg (glob)
20523
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
   102
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
   103
  $ hg bookmarks
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
   104
     W                         3:0d3554f74897
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
   105
     X                         1:6c81ed0049f8
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
   106
     Y                         2:49cb3485fa0c
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
   107
     Z                         2:49cb3485fa0c
f2a0a0e76b4c rebase: do not try to reactivate deleted divergent bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 20117
diff changeset
   108
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   109
Keep bookmarks to the correct rebased changeset
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   110
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   111
  $ cd ..
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   112
  $ hg clone -q a a2
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   113
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   114
  $ cd a2
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   115
  $ hg up -q Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   116
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   117
  $ hg rebase -s 1 -d 3
23517
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   118
  rebasing 1:6c81ed0049f8 "B" (X)
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   119
  rebasing 2:49cb3485fa0c "C" (Y Z)
33332
3b7cb3d17137 rebase: use scmutil.cleanupnodes (issue5606) (BC)
Jun Wu <quark@fb.com>
parents: 28101
diff changeset
   120
  saved backup bundle to $TESTTMP/a2/.hg/strip-backup/6c81ed0049f8-a687065f-rebase.hg (glob)
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   121
17345
4f8054d3171b check-code: fix check for trailing whitespace on sh command lines
Mads Kiilerich <mads@kiilerich.com>
parents: 17059
diff changeset
   122
  $ hg tglog
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   123
  @  3: 'C' bookmarks: Y Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   124
  |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   125
  o  2: 'B' bookmarks: X
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   126
  |
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   127
  o  1: 'D' bookmarks: W
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   128
  |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   129
  o  0: 'A' bookmarks:
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   130
  
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   131
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   132
Keep active bookmark on the correct changeset
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   133
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   134
  $ cd ..
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   135
  $ hg clone -q a a3
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   136
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   137
  $ cd a3
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   138
  $ hg up -q X
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   139
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   140
  $ hg rebase -d W
23517
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   141
  rebasing 1:6c81ed0049f8 "B" (X)
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   142
  rebasing 2:49cb3485fa0c "C" (Y Z)
33332
3b7cb3d17137 rebase: use scmutil.cleanupnodes (issue5606) (BC)
Jun Wu <quark@fb.com>
parents: 28101
diff changeset
   143
  saved backup bundle to $TESTTMP/a3/.hg/strip-backup/6c81ed0049f8-a687065f-rebase.hg (glob)
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   144
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   145
  $ hg tglog
19925
9c78ed396075 rebase: preserve working directory parent (BC)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19641
diff changeset
   146
  o  3: 'C' bookmarks: Y Z
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   147
  |
19925
9c78ed396075 rebase: preserve working directory parent (BC)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19641
diff changeset
   148
  @  2: 'B' bookmarks: X
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   149
  |
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   150
  o  1: 'D' bookmarks: W
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   151
  |
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   152
  o  0: 'A' bookmarks:
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   153
  
19926
0f99747202f9 rebase: preserve active bookmark when not at head (issue3813)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19925
diff changeset
   154
  $ hg bookmarks
0f99747202f9 rebase: preserve active bookmark when not at head (issue3813)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19925
diff changeset
   155
     W                         1:41acb9dca9eb
0f99747202f9 rebase: preserve active bookmark when not at head (issue3813)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19925
diff changeset
   156
   * X                         2:e926fccfa8ec
0f99747202f9 rebase: preserve active bookmark when not at head (issue3813)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19925
diff changeset
   157
     Y                         3:3d5fa227f4b5
0f99747202f9 rebase: preserve active bookmark when not at head (issue3813)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19925
diff changeset
   158
     Z                         3:3d5fa227f4b5
0f99747202f9 rebase: preserve active bookmark when not at head (issue3813)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19925
diff changeset
   159
18549
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   160
rebase --continue with bookmarks present (issue3802)
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   161
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   162
  $ hg up 2
19925
9c78ed396075 rebase: preserve working directory parent (BC)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19641
diff changeset
   163
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
21404
ca275f7ec576 update: when deactivating a bookmark, print a message
Siddharth Agarwal <sid0@fb.com>
parents: 21267
diff changeset
   164
  (leaving bookmark X)
18549
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   165
  $ echo 'C' > c
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   166
  $ hg add c
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   167
  $ hg ci -m 'other C'
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   168
  created new head
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   169
  $ hg up 3
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   170
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28101
79437fb352ce tests: add an explicit destination in some rebase tests
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27626
diff changeset
   171
  $ hg rebase --dest 4
23517
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   172
  rebasing 3:3d5fa227f4b5 "C" (Y Z)
18549
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   173
  merging c
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 23835
diff changeset
   174
  warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
18933
42b620fc89e2 rebase: switch from util.Abort to util.InterventionRequired where appropriate (bc)
Augie Fackler <raf@durin42.com>
parents: 18549
diff changeset
   175
  unresolved conflicts (see hg resolve, then hg rebase --continue)
18935
e5d9441ec281 dispatch: exit with status 1 for an InterventionRequired exception (bc)
Augie Fackler <raf@durin42.com>
parents: 18933
diff changeset
   176
  [1]
18549
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   177
  $ echo 'c' > c
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   178
  $ hg resolve --mark c
21947
b081decd9062 resolve: add parenthesis around "no more unresolved files" message
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21404
diff changeset
   179
  (no more unresolved files)
27626
157675d0f600 rebase: hook afterresolvedstates
timeless <timeless@mozdev.org>
parents: 26614
diff changeset
   180
  continue: hg rebase --continue
18549
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   181
  $ hg rebase --continue
23517
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   182
  rebasing 3:3d5fa227f4b5 "C" (Y Z)
33332
3b7cb3d17137 rebase: use scmutil.cleanupnodes (issue5606) (BC)
Jun Wu <quark@fb.com>
parents: 28101
diff changeset
   183
  saved backup bundle to $TESTTMP/a3/.hg/strip-backup/3d5fa227f4b5-c6ea2371-rebase.hg (glob)
18549
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   184
  $ hg tglog
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   185
  @  4: 'C' bookmarks: Y Z
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   186
  |
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   187
  o  3: 'other C' bookmarks:
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   188
  |
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   189
  o  2: 'B' bookmarks: X
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   190
  |
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   191
  o  1: 'D' bookmarks: W
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   192
  |
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   193
  o  0: 'A' bookmarks:
12de53323e59 rebase: derive node from target rev (issue3802)
Siddharth Agarwal <sid0@fb.com>
parents: 18514
diff changeset
   194
  
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
   195
19641
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   196
ensure that bookmarks given the names of revset functions can be used
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   197
as --rev arguments (issue3950)
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   198
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   199
  $ hg update -q 3
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   200
  $ echo bimble > bimble
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   201
  $ hg add bimble
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   202
  $ hg commit -q -m 'bisect'
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   203
  $ echo e >> bimble
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   204
  $ hg ci -m bisect2
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   205
  $ echo e >> bimble
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   206
  $ hg ci -m bisect3
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   207
  $ hg book bisect
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   208
  $ hg update -q Y
5528c31c629c rebase: handle bookmarks matching revset function names (issue3950)
Bryan O'Sullivan <bryano@fb.com>
parents: 18935
diff changeset
   209
  $ hg rebase -r '"bisect"^^::"bisect"^' -r bisect -d Z
23517
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   210
  rebasing 5:345c90f326a4 "bisect"
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   211
  rebasing 6:f677a2907404 "bisect2"
34290
4f969b9e0cf5 rebase: also include other namespaces in changeset description
Martin von Zweigbergk <martinvonz@google.com>
parents: 33332
diff changeset
   212
  rebasing 7:325c16001345 "bisect3" (bisect tip)
33332
3b7cb3d17137 rebase: use scmutil.cleanupnodes (issue5606) (BC)
Jun Wu <quark@fb.com>
parents: 28101
diff changeset
   213
  saved backup bundle to $TESTTMP/a3/.hg/strip-backup/345c90f326a4-b4840586-rebase.hg (glob)
34354
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   214
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   215
Bookmark and working parent get moved even if --keep is set (issue5682)
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   216
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   217
  $ hg init $TESTTMP/book-keep
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   218
  $ cd $TESTTMP/book-keep
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   219
  $ hg debugdrawdag <<'EOS'
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   220
  > B C
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   221
  > |/
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   222
  > A
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   223
  > EOS
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   224
  $ eval `hg tags -T 'hg bookmark -ir {node} {tag};\n' | grep -v tip`
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   225
  $ rm .hg/localtags
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   226
  $ hg up -q B
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   227
  $ hg tglog
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   228
  o  2: 'C' bookmarks: C
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   229
  |
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   230
  | @  1: 'B' bookmarks: B
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   231
  |/
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   232
  o  0: 'A' bookmarks: A
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   233
  
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   234
  $ hg rebase -r B -d C --keep
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   235
  rebasing 1:112478962961 "B" (B)
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   236
  $ hg tglog
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   237
  @  3: 'B' bookmarks: B
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   238
  |
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   239
  o  2: 'C' bookmarks: C
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   240
  |
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   241
  | o  1: 'B' bookmarks:
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   242
  |/
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   243
  o  0: 'A' bookmarks: A
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   244
  
2f427b57bf90 rebase: move bookmarks with --keep (issue5682)
Jun Wu <quark@fb.com>
parents: 33332
diff changeset
   245