tests/test-grab.t
author Pulkit Goyal <7895pulkit@gmail.com>
Wed, 23 May 2018 02:33:14 +0530
changeset 3754 73ee40cbfb53
parent 3527 7b4d1bfb6b7d
child 3590 d5adce52cef4
child 4048 d7034826c0a2
permissions -rw-r--r--
evolve: return the new replacement node to be stored in evolvestate While resolving phase-divergence, we can end up obsoleting the phase-divergent commit in favor of the public commit. Before this patch we return the node of public commit to store as a replacement of the phase-divergent commit. The above will not cause any problem till the time we use `hg evolve --abort` on an interrupted evolve which tries to strip the replacement nodes because it thinks that the replacements nodes are the ones which are created during the resolution and are new. Since we will be stripping a public node, `evolve --abort` will error out saying cannot strip public changeset, unable to abort evolve which is bad. We should make sure, replacements should only consist of new nodes formed. If the instablity is resolved by obsoleting in favour of old changeset, we should not store the old changeset in replacements in evolvestate.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     1
Test for the grab command
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     2
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     3
  $ cat >> $HGRCPATH <<EOF
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     4
  > [alias]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     5
  > glog = log -G -T "{rev}:{node|short} {desc}\n"
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     6
  > [extensions]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     7
  > EOF
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     8
  $ 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
     9
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    10
  $ mkcommit() {
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    11
  >    echo "$1" > "$1"
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    12
  >    hg add "$1"
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    13
  >    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
    14
  > }
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    15
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    16
  $ hg init repo
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    17
  $ cd repo
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    18
  $ hg help grab
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    19
  hg grab [-r] rev
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    20
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    21
  grabs a commit, move it on the top of working directory parent and
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    22
      updates to it.
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
  options:
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    25
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    26
   -r --rev VALUE revision to grab
3522
7fa887cb1a6e grab: add short version for continue and abort
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3475
diff changeset
    27
   -c --continue  continue interrupted grab
7fa887cb1a6e grab: add short version for continue and abort
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3475
diff changeset
    28
   -a --abort     abort interrupted grab
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    29
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    30
  (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
    31
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    32
  $ mkcommit a
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    33
  $ mkcommit b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    34
  $ mkcommit c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    35
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    36
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    37
  @  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
    38
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    39
  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
    40
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    41
  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
    42
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    43
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    44
Grabbing an ancestor
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    45
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    46
  $ hg grab -r 7c3bad9141dc
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    47
  abort: cannot grab an ancestor revision
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    48
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    49
3527
7b4d1bfb6b7d grab: gracefully handle the case when we try to grab parent of wdir
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3526
diff changeset
    50
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
    51
7b4d1bfb6b7d grab: gracefully handle the case when we try to grab parent of wdir
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3526
diff changeset
    52
  $ hg grab -r .
7b4d1bfb6b7d grab: gracefully handle the case when we try to grab parent of wdir
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3526
diff changeset
    53
  abort: cannot grab an ancestor revision
7b4d1bfb6b7d grab: gracefully handle the case when we try to grab parent of wdir
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3526
diff changeset
    54
  [255]
7b4d1bfb6b7d grab: gracefully handle the case when we try to grab parent of wdir
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3526
diff changeset
    55
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    56
Specifying multiple revisions to grab
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    57
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    58
  $ hg grab 1f0dee641bb7 -r 7c3bad9141dc
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    59
  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
    60
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    61
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    62
Specifying no revisions to grab
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    63
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    64
  $ hg grab
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    65
  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
    66
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    67
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    68
Continuing without interrupted grab
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    69
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    70
  $ hg grab --continue
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    71
  abort: no interrupted grab state exists
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    72
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    73
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    74
Aborting without interrupted grab
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    75
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    76
  $ hg grab --abort
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    77
  abort: no interrupted grab state exists
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    78
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    79
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    80
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
    81
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    82
  $ hg up 1f0dee641bb7
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    83
  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
    84
  $ hg grab -r 4538525df7e2 --continue
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    85
  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
    86
  [255]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    87
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    88
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
    89
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    90
  $ mkcommit x
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    91
  created new head
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    92
  $ mkcommit y
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    93
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    94
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    95
  @  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
    96
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    97
  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
    98
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    99
  | 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
   100
  | |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   101
  | 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
   102
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   103
  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
   104
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   105
Grabbing a revision
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   106
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   107
  $ hg grab 7c3bad9141dc
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   108
  grabbing 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
   109
  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
   110
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   111
  @  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
   112
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   113
  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
   114
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   115
  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
   116
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   117
  | *  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
   118
  | |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   119
  | 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
   120
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   121
  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
   122
  
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
When grab does not create any changes
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
  $ 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
   127
  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
   128
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   129
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   130
  @  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
   131
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   132
  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
   133
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   134
  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
   135
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   136
  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
   137
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   138
  | *  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
  | 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
   141
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   142
  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
   143
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   144
  $ hg grab -r 4538525df7e2
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   145
  grabbing 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
   146
  note: grab of 2:4538525df7e2 created no changes to commit
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   147
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   148
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   149
  @  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
   150
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   151
  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
   152
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   153
  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
   154
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   155
  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
   156
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   157
  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
   158
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   159
interrupted grab
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   160
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   161
  $ hg up d46dc301d92f
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   162
  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
   163
  $ echo foo > c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   164
  $ hg ci -Aqm "foo to c"
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   165
  $ hg grab -r c4636a81ebeb
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   166
  grabbing 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
   167
  merging c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   168
  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
   169
  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
   170
  [1]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   171
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   172
  $ echo foobar > c
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   173
  $ 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
   174
  (no more unresolved files)
3473
b2f591aa4507 grab: add grab info to cmdutil.afterresolvedstates
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3453
diff changeset
   175
  continue: hg grab --continue
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   176
  $ hg grab --continue
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   177
  $ hg glog
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   178
  @  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
   179
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   180
  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
   181
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   182
  | 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
   183
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   184
  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
   185
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   186
  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
   187
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   188
  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
   189
  
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   190
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   191
When interrupted grab results in no changes to commit
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   192
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   193
  $ hg up d46dc301d92f
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   194
  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
   195
  $ echo bar > c
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   196
  $ hg add c
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   197
  $ 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
   198
  created new head
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   199
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   200
  $ hg up 44e155eb95c7
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   201
  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
   202
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   203
  $ hg grab 4e04628911f6
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   204
  grabbing 9:4e04628911f6 "foo to c"
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   205
  merging c
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   206
  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
   207
  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
   208
  [1]
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   209
  $ echo foobar > c
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   210
  $ hg resolve -m
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   211
  (no more unresolved files)
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   212
  continue: hg grab --continue
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   213
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   214
  $ hg grab --continue
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   215
  note: grab of 9:4e04628911f6 created no changes to commit
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   216
3453
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   217
Testing the abort functionality of hg grab
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   218
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   219
  $ echo foo > b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   220
  $ 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
   221
  $ 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
   222
  @  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
   223
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   224
  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
   225
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   226
  ~
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   227
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   228
  $ hg grab -r 7c15c05db6fa
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   229
  grabbing 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
   230
  merging b
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   231
  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
   232
  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
   233
  [1]
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   234
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   235
  $ hg grab --abort
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   236
  aborting grab, 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
   237
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   238
  $ hg glog
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   239
  @  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
   240
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   241
  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
   242
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   243
  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
   244
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   245
  | 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
   246
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   247
  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
   248
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   249
  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
   250
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   251
  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
   252
  
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   253
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   254
Trying to grab a public changeset
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   255
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   256
  $ 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
   257
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   258
  $ hg grab -r 7c15c05db6fa
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   259
  abort: cannot grab public changesets: 7c15c05db6fa
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   260
  (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
   261
  [255]
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
  $ hg glog
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   264
  @  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
   265
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   266
  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
   267
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   268
  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
   269
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   270
  | 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
   271
  |/
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   272
  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
   273
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   274
  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
   275
  |
32ed5b6fadd3 grab: add a command to grab a commit and update to it
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   276
  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
   277
  
3474
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   278
Checking phase preservation while grabbing secret changeset
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   279
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   280
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
   281
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   282
  $ 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
   283
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   284
  $ hg grab -r 7c15c05db6fa
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   285
  grabbing 5:7c15c05db6fa "add b"
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   286
  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
   287
  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
   288
  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
   289
  [1]
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   290
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   291
  $ 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
   292
  $ 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
   293
  (no more unresolved files)
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   294
  continue: hg grab --continue
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   295
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   296
  $ hg grab --continue
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   297
  $ 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
   298
  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
   299
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   300
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
   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
  $ 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
   303
  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
   304
  $ 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
   305
  $ 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
   306
  $ 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
   307
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   308
  $ 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
   309
  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
   310
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   311
  $ hg glog
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   312
  @  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
   313
  |
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   314
  | 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
   315
  | |
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   316
  | 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
   317
  | |
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   318
  | 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
   319
  | |
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   320
  | 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
   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
  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
   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
  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
   325
  |
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   326
  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
   327
  
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   328
  $ 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
   329
  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
   330
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   331
  $ hg grab -r 508d572e7053
3526
df20ddc79064 grab: move the initialization of pctx variable outside of if-else
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3522
diff changeset
   332
  grabbing 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
   333
05fe5239fca2 tests: add a test showing grabbing of secret changeset turn it into draft
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3473
diff changeset
   334
  $ 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
   335
  13: secret