tests/test-pick.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Mon, 09 Dec 2019 23:54:50 +0100
branchmercurial-4.5
changeset 4987 e1f53a68b146
parent 4971 9f69164cdc16
child 5367 cb5983c0287f
permissions -rw-r--r--
test-compat: merge mercurial-4.6 into mercurial-4.5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4863
5cd7d16b8733 test-compat: merge stable into mercurial-5.0
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4800
diff changeset
     1
#testcases abortflag
4484
302cd64f71e1 tests: rename test-grab to test-pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232
diff changeset
     2
Test for the pick command
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     3
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     4
  $ cat >> $HGRCPATH <<EOF
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     5
  > [alias]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     6
  > glog = log -G -T "{rev}:{node|short} {desc}\n"
4686
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
     7
  > glf = log -GT "{rev}: {desc} ({files})\n"
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     8
  > [extensions]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     9
  > EOF
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    10
  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    11
4800
fa534a8c5863 pick: added support for hg abort
Taapas Agrawal <taapas2897@gmail.com>
parents: 4687
diff changeset
    12
#if abortflag
fa534a8c5863 pick: added support for hg abort
Taapas Agrawal <taapas2897@gmail.com>
parents: 4687
diff changeset
    13
  $ cat >> $HGRCPATH <<EOF
fa534a8c5863 pick: added support for hg abort
Taapas Agrawal <taapas2897@gmail.com>
parents: 4687
diff changeset
    14
  > [alias]
fa534a8c5863 pick: added support for hg abort
Taapas Agrawal <taapas2897@gmail.com>
parents: 4687
diff changeset
    15
  > abort = pick --abort
fa534a8c5863 pick: added support for hg abort
Taapas Agrawal <taapas2897@gmail.com>
parents: 4687
diff changeset
    16
  > EOF
fa534a8c5863 pick: added support for hg abort
Taapas Agrawal <taapas2897@gmail.com>
parents: 4687
diff changeset
    17
#endif
fa534a8c5863 pick: added support for hg abort
Taapas Agrawal <taapas2897@gmail.com>
parents: 4687
diff changeset
    18
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    19
  $ mkcommit() {
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    20
  >    echo "$1" > "$1"
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    21
  >    hg add "$1"
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    22
  >    hg ci -m "add $1"
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    23
  > }
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    24
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    25
  $ hg init repo
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    26
  $ cd repo
4484
302cd64f71e1 tests: rename test-grab to test-pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232
diff changeset
    27
  $ hg help pick
4915
5113b38cb677 evolve: use more often seen metavariables in command synopsis strings
Anton Shestakov <av6@dwimlabs.net>
parents: 4891
diff changeset
    28
  hg pick [OPTION]... [-r] REV
4048
d7034826c0a2 pick: rename the grab command to pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3527
diff changeset
    29
  
d7034826c0a2 pick: rename the grab command to pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3527
diff changeset
    30
  aliases: grab
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    31
  
4229
a8ed26f01c8d pick: `hg help` was not showing the full cmd desc of `pick`
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4053
diff changeset
    32
  move a commit on the top of working directory parent and updates to it.
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    33
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    34
  options:
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    35
  
4512
7a779a288793 test-compat: merge mercurial-4.8 into mercurial-4.7
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232 4491
diff changeset
    36
   -r --rev REV    revision to pick
7a779a288793 test-compat: merge mercurial-4.8 into mercurial-4.7
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232 4491
diff changeset
    37
   -c --continue   continue interrupted pick
7a779a288793 test-compat: merge mercurial-4.8 into mercurial-4.7
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232 4491
diff changeset
    38
   -a --abort      abort interrupted pick
7a779a288793 test-compat: merge mercurial-4.8 into mercurial-4.7
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232 4491
diff changeset
    39
   -t --tool VALUE specify merge tool
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    40
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    41
  (some details hidden, use --verbose to show complete help)
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    42
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    43
  $ mkcommit a
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    44
  $ mkcommit b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    45
  $ mkcommit c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    46
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    47
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    48
  @  2:4538525df7e2 add c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    49
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    50
  o  1:7c3bad9141dc add b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    51
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    52
  o  0:1f0dee641bb7 add a
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    53
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    54
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    55
Grabbing an ancestor
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    56
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
    57
  $ hg pick -r 7c3bad9141dc
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
    58
  abort: cannot pick an ancestor revision
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    59
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    60
3527
7b4d1bfb6b7d grab: gracefully handle the case when we try to grab parent of wdir
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3526
diff changeset
    61
Grabbing the working directory parent
7b4d1bfb6b7d grab: gracefully handle the case when we try to grab parent of wdir
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3526
diff changeset
    62
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
    63
  $ hg pick -r .
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
    64
  abort: cannot pick an ancestor revision
3527
7b4d1bfb6b7d grab: gracefully handle the case when we try to grab parent of wdir
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3526
diff changeset
    65
  [255]
7b4d1bfb6b7d grab: gracefully handle the case when we try to grab parent of wdir
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3526
diff changeset
    66
4484
302cd64f71e1 tests: rename test-grab to test-pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232
diff changeset
    67
Specifying multiple revisions to pick
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    68
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
    69
  $ hg pick 1f0dee641bb7 -r 7c3bad9141dc
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    70
  abort: specify just one revision
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    71
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    72
4484
302cd64f71e1 tests: rename test-grab to test-pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232
diff changeset
    73
Specifying no revisions to pick
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    74
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
    75
  $ hg pick
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    76
  abort: empty revision set
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    77
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    78
4484
302cd64f71e1 tests: rename test-grab to test-pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232
diff changeset
    79
Continuing without interrupted pick
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    80
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
    81
  $ hg pick --continue
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
    82
  abort: no interrupted pick state exists
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    83
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    84
4484
302cd64f71e1 tests: rename test-grab to test-pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232
diff changeset
    85
Aborting without interrupted pick
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    86
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
    87
  $ hg pick --abort
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
    88
  abort: no interrupted pick state exists
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    89
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    90
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    91
Specifying both continue and revs
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    92
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    93
  $ hg up 1f0dee641bb7
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    94
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
    95
  $ hg pick -r 4538525df7e2 --continue
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    96
  abort: cannot specify both --continue and revision
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    97
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    98
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    99
Making new branch heads
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   100
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   101
  $ mkcommit x
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   102
  created new head
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   103
  $ mkcommit y
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   104
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   105
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   106
  @  4:d46dc301d92f add y
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   107
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   108
  o  3:8e224524cd09 add x
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   109
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   110
  | o  2:4538525df7e2 add c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   111
  | |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   112
  | o  1:7c3bad9141dc add b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   113
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   114
  o  0:1f0dee641bb7 add a
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   115
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   116
Grabbing a revision
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   117
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   118
  $ hg pick 7c3bad9141dc
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
   119
  picking 1:7c3bad9141dc "add b"
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   120
  1 new orphan changesets
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   121
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   122
  @  5:7c15c05db6fa add b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   123
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   124
  o  4:d46dc301d92f add y
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   125
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   126
  o  3:8e224524cd09 add x
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   127
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   128
  | *  2:4538525df7e2 add c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   129
  | |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   130
  | x  1:7c3bad9141dc add b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   131
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   132
  o  0:1f0dee641bb7 add a
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   133
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   134
4484
302cd64f71e1 tests: rename test-grab to test-pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232
diff changeset
   135
When pick does not create any changes
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   136
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   137
  $ hg graft -r 4538525df7e2
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   138
  grafting 2:4538525df7e2 "add c"
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   139
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   140
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   141
  @  6:c4636a81ebeb add c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   142
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   143
  o  5:7c15c05db6fa add b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   144
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   145
  o  4:d46dc301d92f add y
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   146
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   147
  o  3:8e224524cd09 add x
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   148
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   149
  | *  2:4538525df7e2 add c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   150
  | |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   151
  | x  1:7c3bad9141dc add b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   152
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   153
  o  0:1f0dee641bb7 add a
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   154
  
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   155
  $ hg pick -r 4538525df7e2
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
   156
  picking 2:4538525df7e2 "add c"
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
   157
  note: picking 2:4538525df7e2 created no changes to commit
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   158
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   159
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   160
  @  6:c4636a81ebeb add c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   161
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   162
  o  5:7c15c05db6fa add b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   163
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   164
  o  4:d46dc301d92f add y
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   165
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   166
  o  3:8e224524cd09 add x
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   167
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   168
  o  0:1f0dee641bb7 add a
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   169
  
4891
a9929dd36405 pick: don't create any successors when there were no changes (issue6093)
Anton Shestakov <av6@dwimlabs.net>
parents: 4800
diff changeset
   170
a9929dd36405 pick: don't create any successors when there were no changes (issue6093)
Anton Shestakov <av6@dwimlabs.net>
parents: 4800
diff changeset
   171
there were no changes to commit, so there shouldn't be any predecessors of 6,
a9929dd36405 pick: don't create any successors when there were no changes (issue6093)
Anton Shestakov <av6@dwimlabs.net>
parents: 4800
diff changeset
   172
and 2 should say it was pruned (issue6093)
a9929dd36405 pick: don't create any successors when there were no changes (issue6093)
Anton Shestakov <av6@dwimlabs.net>
parents: 4800
diff changeset
   173
a9929dd36405 pick: don't create any successors when there were no changes (issue6093)
Anton Shestakov <av6@dwimlabs.net>
parents: 4800
diff changeset
   174
  $ hg olog --all --hidden -r 2+6
a9929dd36405 pick: don't create any successors when there were no changes (issue6093)
Anton Shestakov <av6@dwimlabs.net>
parents: 4800
diff changeset
   175
  x  4538525df7e2 (2) add c
a9929dd36405 pick: don't create any successors when there were no changes (issue6093)
Anton Shestakov <av6@dwimlabs.net>
parents: 4800
diff changeset
   176
       pruned using pick by test (Thu Jan 01 00:00:00 1970 +0000)
a9929dd36405 pick: don't create any successors when there were no changes (issue6093)
Anton Shestakov <av6@dwimlabs.net>
parents: 4800
diff changeset
   177
  
a9929dd36405 pick: don't create any successors when there were no changes (issue6093)
Anton Shestakov <av6@dwimlabs.net>
parents: 4800
diff changeset
   178
  @  c4636a81ebeb (6) add c
a9929dd36405 pick: don't create any successors when there were no changes (issue6093)
Anton Shestakov <av6@dwimlabs.net>
parents: 4800
diff changeset
   179
  
a9929dd36405 pick: don't create any successors when there were no changes (issue6093)
Anton Shestakov <av6@dwimlabs.net>
parents: 4800
diff changeset
   180
4484
302cd64f71e1 tests: rename test-grab to test-pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232
diff changeset
   181
interrupted pick
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   182
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   183
  $ hg up d46dc301d92f
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   184
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   185
  $ echo foo > c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   186
  $ hg ci -Aqm "foo to c"
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   187
  $ hg pick -r c4636a81ebeb
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
   188
  picking 6:c4636a81ebeb "add c"
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   189
  merging c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   190
  warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   191
  unresolved merge conflicts (see hg help resolve)
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   192
  [1]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   193
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   194
  $ echo foobar > c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   195
  $ hg resolve --all --mark
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   196
  (no more unresolved files)
4052
73e73471d6c6 pick: replace "grabstate" with "pickstate"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4049
diff changeset
   197
  continue: hg pick --continue
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   198
  $ hg pick --continue
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   199
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   200
  @  8:44e155eb95c7 add c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   201
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   202
  o  7:2ccc03d1d096 foo to c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   203
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   204
  | o  5:7c15c05db6fa add b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   205
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   206
  o  4:d46dc301d92f add y
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   207
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   208
  o  3:8e224524cd09 add x
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   209
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   210
  o  0:1f0dee641bb7 add a
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   211
  
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   212
4484
302cd64f71e1 tests: rename test-grab to test-pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232
diff changeset
   213
When interrupted pick results in no changes to commit
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   214
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   215
  $ hg up d46dc301d92f
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   216
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   217
  $ echo bar > c
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   218
  $ hg add c
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   219
  $ hg ci -m "foo to c"
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   220
  created new head
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   221
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   222
  $ hg up 44e155eb95c7
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   223
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   224
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   225
  $ hg pick 4e04628911f6
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
   226
  picking 9:4e04628911f6 "foo to c"
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   227
  merging c
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   228
  warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   229
  unresolved merge conflicts (see hg help resolve)
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   230
  [1]
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   231
  $ echo foobar > c
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   232
  $ hg resolve -m
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   233
  (no more unresolved files)
4052
73e73471d6c6 pick: replace "grabstate" with "pickstate"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4049
diff changeset
   234
  continue: hg pick --continue
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   235
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   236
  $ hg pick --continue
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
   237
  note: picking 9:4e04628911f6 created no changes to commit
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   238
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   239
Testing the abort functionality of hg pick
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   240
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   241
  $ echo foo > b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   242
  $ hg ci -Aqm "foo to b"
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   243
  $ hg glog -r .^::
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   244
  @  10:c437988de89f foo to b
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   245
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   246
  o  8:44e155eb95c7 add c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   247
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   248
  ~
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   249
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   250
  $ hg pick -r 7c15c05db6fa
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
   251
  picking 5:7c15c05db6fa "add b"
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   252
  merging b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   253
  warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   254
  unresolved merge conflicts (see hg help resolve)
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   255
  [1]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   256
4800
fa534a8c5863 pick: added support for hg abort
Taapas Agrawal <taapas2897@gmail.com>
parents: 4687
diff changeset
   257
  $ hg abort
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
   258
  aborting pick, updating to c437988de89f
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   259
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   260
  $ hg glog
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   261
  @  10:c437988de89f foo to b
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   262
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   263
  o  8:44e155eb95c7 add c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   264
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   265
  o  7:2ccc03d1d096 foo to c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   266
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   267
  | o  5:7c15c05db6fa add b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   268
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   269
  o  4:d46dc301d92f add y
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   270
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   271
  o  3:8e224524cd09 add x
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   272
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   273
  o  0:1f0dee641bb7 add a
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   274
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   275
4484
302cd64f71e1 tests: rename test-grab to test-pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232
diff changeset
   276
Trying to pick a public changeset
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   277
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   278
  $ hg phase -r 7c15c05db6fa -p
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   279
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   280
  $ hg pick -r 7c15c05db6fa
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
   281
  abort: cannot pick public changesets: 7c15c05db6fa
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   282
  (see 'hg help phases' for details)
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   283
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   284
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   285
  $ hg glog
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   286
  @  10:c437988de89f foo to b
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   287
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   288
  o  8:44e155eb95c7 add c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   289
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   290
  o  7:2ccc03d1d096 foo to c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   291
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   292
  | o  5:7c15c05db6fa add b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   293
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   294
  o  4:d46dc301d92f add y
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   295
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   296
  o  3:8e224524cd09 add x
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   297
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   298
  o  0:1f0dee641bb7 add a
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   299
  
4484
302cd64f71e1 tests: rename test-grab to test-pick
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4232
diff changeset
   300
Checking phase preservation while picking secret changeset
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   301
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   302
In case of merge conflicts
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   303
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   304
  $ hg phase -r 7c15c05db6fa -s -f
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   305
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   306
  $ hg pick -r 7c15c05db6fa
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
   307
  picking 5:7c15c05db6fa "add b"
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   308
  merging b
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   309
  warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   310
  unresolved merge conflicts (see hg help resolve)
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   311
  [1]
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   312
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   313
  $ echo bar > b
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   314
  $ hg resolve -m
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   315
  (no more unresolved files)
4052
73e73471d6c6 pick: replace "grabstate" with "pickstate"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4049
diff changeset
   316
  continue: hg pick --continue
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   317
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   318
  $ hg pick --continue
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   319
  $ hg phase -r .
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   320
  11: secret
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   321
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   322
No merge conflicts
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   323
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   324
  $ hg up d46dc301d92f
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   325
  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   326
  $ echo foo > l
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   327
  $ hg add l
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   328
  $ hg ci -qm "added l" --secret
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   329
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   330
  $ hg phase -r .
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   331
  12: secret
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   332
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   333
  $ hg glog
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   334
  @  12:508d572e7053 added l
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   335
  |
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   336
  | o  11:10427de9e26e add b
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   337
  | |
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   338
  | o  10:c437988de89f foo to b
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   339
  | |
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   340
  | o  8:44e155eb95c7 add c
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   341
  | |
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   342
  | o  7:2ccc03d1d096 foo to c
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   343
  |/
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   344
  o  4:d46dc301d92f add y
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   345
  |
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   346
  o  3:8e224524cd09 add x
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   347
  |
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   348
  o  0:1f0dee641bb7 add a
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   349
  
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   350
  $ hg up 10427de9e26e
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   351
  3 files updated, 0 files merged, 1 files removed, 0 files unresolved
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   352
4053
ecbf61d90807 pick: replace `hg grab` invocation in test with `hg pick`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4052
diff changeset
   353
  $ hg pick -r 508d572e7053
4049
25981fae92f9 pick: update command output to mention pick instead of grab
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4048
diff changeset
   354
  picking 12:508d572e7053 "added l"
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   355
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   356
  $ hg phase -r .
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   357
  13: secret
4485
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   358
  $ cd ..
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   359
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   360
Check pick behavior regarding working copy branch (issue6089)
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   361
-------------------------------------------------------------
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   362
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   363
The branch of the picked changeset should be preserved, and the working copy updated
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   364
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   365
  $ hg init issue6089
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   366
  $ cd issue6089
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   367
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   368
  $ touch a
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   369
  $ hg add a
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   370
  $ hg ci -m 'first commit on default'
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   371
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   372
  $ hg branch foo
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   373
  marked working directory as branch foo
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   374
  (branches are permanent and global, did you want a bookmark?)
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   375
  $ touch b
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   376
  $ hg add b
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   377
  $ hg ci -m 'first commit on foo'
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   378
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   379
  $ hg up default
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   380
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   381
  $ echo test > a
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   382
  $ hg ci -m 'second commit on default'
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   383
  $ hg log -G --template '{node|short}: {branch}\n' --rev 'all()+wdir()'
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   384
  o  ffffffffffff: default
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   385
  |
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   386
  @  5f07cbf7d111: default
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   387
  |
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   388
  | o  96bb2057779e: foo
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   389
  |/
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   390
  o  d03a6bcc83cd: default
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   391
  
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   392
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   393
  $ hg pick 1
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   394
  picking 1:96bb2057779e "first commit on foo"
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   395
  $ hg log --template '{branch}\n' -r tip
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   396
  foo
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   397
  $ hg branch
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   398
  foo
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   399
  $ hg log -G --template '{node|short}: {branch}\n' --rev 'all()+wdir()'
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   400
  o  ffffffffffff: foo
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   401
  |
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   402
  @  5344a77549bd: foo
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   403
  |
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   404
  o  5f07cbf7d111: default
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   405
  |
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   406
  o  d03a6bcc83cd: default
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   407
  
e3785a8d0712 pick: update working dir branch (issue6089)
Manuel Jacob <me@manueljacob.de>
parents: 4484
diff changeset
   408
  $ cd ..
4686
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   409
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   410
Check that pick doesn't drop files after conflicts occur (issue6037)
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   411
--------------------------------------------------------------------
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   412
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   413
  $ hg init issue6037
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   414
  $ cd issue6037
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   415
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   416
  $ echo apple > a
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   417
  $ hg ci -qAm 'apple'
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   418
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   419
  $ echo apricot > a
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   420
  $ echo banana > b
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   421
  $ hg ci -qAm 'apricot and banana'
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   422
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   423
  $ echo avocado > a
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   424
  $ hg ci -m 'avocado'
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   425
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   426
  $ hg glf
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   427
  @  2: avocado (a)
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   428
  |
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   429
  o  1: apricot and banana (a b)
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   430
  |
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   431
  o  0: apple (a)
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   432
  
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   433
Now let's change order of 1 and 2 using pick command
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   434
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   435
  $ hg up -r 0
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   436
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   437
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   438
We avoid merge conflict here just to make the test shorter
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   439
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   440
  $ hg pick -r 2 --tool :other
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   441
  picking 2:f08a1e4a33c4 "avocado"
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   442
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   443
Now we pick revision 1 that touches two files (a and b), merge conflict is expected
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   444
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   445
  $ hg pick -r 1
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   446
  picking 1:892e123ebf62 "apricot and banana"
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   447
  merging a
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   448
  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   449
  unresolved merge conflicts (see hg help resolve)
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   450
  [1]
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   451
  $ hg resolve -t :other a
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   452
  (no more unresolved files)
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   453
  continue: hg pick --continue
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   454
  $ hg pick --continue
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   455
4687
313565dd75e3 pick: remove transaction on the whole command (issue6037)
Anton Shestakov <av6@dwimlabs.net>
parents: 4686
diff changeset
   456
Demonstrate that b was not forgotten and is definitely included in 4
4686
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   457
4687
313565dd75e3 pick: remove transaction on the whole command (issue6037)
Anton Shestakov <av6@dwimlabs.net>
parents: 4686
diff changeset
   458
  $ hg status b -A
313565dd75e3 pick: remove transaction on the whole command (issue6037)
Anton Shestakov <av6@dwimlabs.net>
parents: 4686
diff changeset
   459
  C b
4686
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   460
  $ hg glf
4687
313565dd75e3 pick: remove transaction on the whole command (issue6037)
Anton Shestakov <av6@dwimlabs.net>
parents: 4686
diff changeset
   461
  @  4: apricot and banana (a b)
4686
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   462
  |
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   463
  o  3: avocado (a)
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   464
  |
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   465
  o  0: apple (a)
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   466
  
f1466f5ffbf5 tests: demonstrate hg pick forgetting files after conflicts
Anton Shestakov <av6@dwimlabs.net>
parents: 4491
diff changeset
   467
  $ cd ..