tests/test-bookflow.t
author idlsoft <idlsoft@gmail.com>
Mon, 03 Dec 2018 14:17:38 -0500
changeset 40852 9cec7a36bab8
child 42548 3de4f17f4824
permissions -rw-r--r--
bookflow: new extension for bookmark-based branching This extension should be helpful for feature branches - based workflows. At my company we first considered branches, but weren't sure about creating a lot of permanent objects. We tried bookmarks, but found some scenarios to be difficult to control. The main problem, was the active bookmark being moved on update. Disabling that made everything a lot more predictable. Bookmarks move on commit, and updating means switching between them. The extension also implements a few minor features to better guide the workflow: - hg bookmark NAME can be ambiguous (create or move), unlike hg branch. The extension requires -rev to move. - require an active bookmark on commit. - some bookmarks can be protected (like @), useful for teams, that require code reviews. - block creation of new branches. The initial implementation requires no changes in the core, but it does rely on some implementation details. I thought it may be useful to discuss the functionality first, and then focus making the code more robust. Differential Revision: https://phab.mercurial-scm.org/D4312
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40852
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
     1
initialize
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
     2
  $ make_changes() {
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
     3
  >     d=`pwd`
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
     4
  >     [ ! -z $1 ] && cd $1
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
     5
  >     echo "test `basename \`pwd\``" >> test
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
     6
  >     hg commit -Am"${2:-test}"
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
     7
  >     r=$?
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
     8
  >     cd $d
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
     9
  >     return $r
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    10
  > }
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    11
  $ ls -1a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    12
  .
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    13
  ..
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    14
  $ hg init a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    15
  $ cd a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    16
  $ echo 'test' > test; hg commit -Am'test'
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    17
  adding test
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    18
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    19
clone to b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    20
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    21
  $ mkdir ../b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    22
  $ cd ../b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    23
  $ hg clone ../a .
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    24
  updating to branch default
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    25
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    26
  $ echo "[extensions]" >> .hg/hgrc
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    27
  $ echo "bookflow=" >> .hg/hgrc
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    28
  $ hg branch X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    29
  abort: creating named branches is disabled and you should use bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    30
  (see 'hg help bookflow')
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    31
  [255]
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    32
  $ hg bookmark X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    33
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    34
  * X                         0:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    35
  $ hg bookmark X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    36
  abort: bookmark X already exists, to move use the --rev option
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    37
  [255]
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    38
  $ make_changes
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    39
  $ hg push ../a -q
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    40
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    41
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    42
   \* X                         1:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    43
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    44
change a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    45
  $ cd ../a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    46
  $ hg up
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    47
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    48
  $ echo 'test' >> test; hg commit -Am'test'
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    49
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    50
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    51
pull in b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    52
  $ cd ../b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    53
  $ hg pull -u
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    54
  pulling from $TESTTMP/a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    55
  searching for changes
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    56
  adding changesets
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    57
  adding manifests
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    58
  adding file changes
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    59
  added 1 changesets with 1 changes to 1 files
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    60
  new changesets * (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    61
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    62
  (leaving bookmark X)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    63
  $ hg status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    64
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    65
     X                         1:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    66
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    67
check protection of @ bookmark
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    68
  $ hg bookmark @
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    69
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    70
   \* @                         2:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    71
     X                         1:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    72
  $ make_changes
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    73
  abort: cannot commit, bookmark @ is protected
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    74
  [255]
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    75
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    76
  $ hg status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    77
  M test
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    78
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    79
   \* @                         2:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    80
     X                         1:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    81
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    82
  $ hg --config bookflow.protect= commit  -Am"Updated test"
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    83
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    84
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    85
   \* @                         3:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    86
     X                         1:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    87
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    88
check requirement for an active bookmark
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    89
  $ hg bookmark -i
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    90
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    91
     @                         3:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    92
     X                         1:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    93
  $ make_changes
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    94
  abort: cannot commit without an active bookmark
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    95
  [255]
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    96
  $ hg revert test
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    97
  $ rm test.orig
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    98
  $ hg status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
    99
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   100
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   101
make the bookmark move by updating it on a, and then pulling
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   102
# add a commit to a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   103
  $ cd ../a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   104
  $ hg bookmark X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   105
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   106
   \* X                         2:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   107
  $ make_changes
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   108
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   109
   * X                         3:81af7977fdb9
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   110
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   111
# go back to b, and check out X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   112
  $ cd ../b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   113
  $ hg up X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   114
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   115
  (activating bookmark X)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   116
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   117
     @                         3:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   118
   \* X                         1:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   119
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   120
# pull, this should move the bookmark forward, because it was changed remotely
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   121
  $ hg pull -u | grep "updating to active bookmark X"
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   122
  updating to active bookmark X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   123
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   124
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   125
     @                         3:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   126
   * X                         4:81af7977fdb9
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   127
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   128
the bookmark should not move if it diverged from remote
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   129
  $ hg -R ../a status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   130
  $ hg -R ../b status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   131
  $ make_changes ../a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   132
  $ make_changes ../b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   133
  $ hg -R ../a status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   134
  $ hg -R ../b status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   135
  $ hg -R ../a bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   136
   * X                         4:238292f60a57
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   137
  $ hg -R ../b bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   138
     @                         3:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   139
   * X                         5:096f7e86892d
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   140
  $ cd ../b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   141
  $ # make sure we cannot push after bookmarks diverged
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   142
  $ hg push -B X | grep abort
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   143
  abort: push creates new remote head * with bookmark 'X'! (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   144
  (pull and merge or see 'hg help push' for details about pushing new heads)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   145
  [1]
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   146
  $ hg pull -u | grep divergent
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   147
  divergent bookmark X stored as X@default
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   148
  1 other divergent bookmarks for "X"
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   149
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   150
     @                         3:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   151
   * X                         5:096f7e86892d
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   152
     X@default                 6:238292f60a57
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   153
  $ hg id -in
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   154
  096f7e86892d 5
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   155
  $ make_changes
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   156
  $ hg status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   157
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   158
     @                         3:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   159
   * X                         7:227f941aeb07
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   160
     X@default                 6:238292f60a57
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   161
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   162
now merge with the remote bookmark
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   163
  $ hg merge X@default --tool :local -q
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   164
  $ hg status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   165
  M test
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   166
  $ hg commit -m"Merged with X@default"
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   167
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   168
     @                         3:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   169
   * X                         8:26fed9bb3219
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   170
  $ hg push -B X | grep bookmark
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   171
  pushing to $TESTTMP/a (?)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   172
  updating bookmark X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   173
  $ cd ../a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   174
  $ hg up -q
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   175
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   176
   * X                         7:26fed9bb3219
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   177
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   178
test hg pull when there is more than one descendant
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   179
  $ cd ../a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   180
  $ hg bookmark Z
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   181
  $ hg bookmark Y
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   182
  $ make_changes . YY
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   183
  $ hg up Z -q
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   184
  $ make_changes . ZZ
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   185
  created new head
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   186
  $ hg bookmarks
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   187
     X                         7:26fed9bb3219
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   188
     Y                         8:131e663dbd2a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   189
   * Z                         9:b74a4149df25
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   190
  $ hg log -r 'p1(Y)' -r 'p1(Z)' -T '{rev}\n' # prove that Y and Z share the same parent
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   191
  7
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   192
  $ hg log -r 'Y%Z' -T '{rev}\n'  # revs in Y but not in Z
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   193
  8
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   194
  $ hg log -r 'Z%Y' -T '{rev}\n'  # revs in Z but not in Y
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   195
  9
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   196
  $ cd ../b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   197
  $ hg pull -uq
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   198
  $ hg id
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   199
  b74a4149df25 tip Z
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   200
  $ hg bookmarks | grep \*  # no active bookmark
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   201
  [1]
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   202
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   203
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   204
test shelving
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   205
  $ cd ../a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   206
  $ echo anotherfile > anotherfile # this change should not conflict
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   207
  $ hg add anotherfile
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   208
  $ hg commit -m"Change in a"
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   209
  $ cd ../b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   210
  $ hg up Z | grep Z
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   211
  (activating bookmark Z)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   212
  $ hg book | grep \* # make sure active bookmark
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   213
   \* Z                         10:* (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   214
  $ echo "test b" >> test
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   215
  $ hg diff --stat
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   216
   test |  1 +
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   217
   1 files changed, 1 insertions(+), 0 deletions(-)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   218
  $ hg --config extensions.shelve= shelve
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   219
  shelved as Z
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   220
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   221
  $ hg pull -uq
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   222
  $ hg --trace --config extensions.shelve= unshelve
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   223
  unshelving change 'Z'
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   224
  rebasing shelved changes
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   225
  $ hg diff --stat
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   226
   test |  1 +
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   227
   1 files changed, 1 insertions(+), 0 deletions(-)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   228
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   229
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   230
make the bookmark move by updating it on a, and then pulling with a local change
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   231
# add a commit to a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   232
  $ cd ../a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   233
  $ hg up -C X |fgrep  "activating bookmark X"
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   234
  (activating bookmark X)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   235
# go back to b, and check out X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   236
  $ cd ../b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   237
  $ hg up -C X |fgrep  "activating bookmark X"
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   238
  (activating bookmark X)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   239
# update and push from a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   240
  $ make_changes ../a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   241
  created new head
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   242
  $ echo "more" >> test
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   243
  $ hg pull -u 2>&1 | fgrep -v TESTTMP| fgrep -v "searching for changes" | fgrep -v adding
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   244
  pulling from $TESTTMP/a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   245
  added 1 changesets with 0 changes to 0 files (+1 heads)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   246
  updating bookmark X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   247
  new changesets * (glob)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   248
  updating to active bookmark X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   249
  merging test
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   250
  warning: conflicts while merging test! (edit, then use 'hg resolve --mark')
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   251
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   252
  use 'hg resolve' to retry unresolved file merges
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   253
  $ hg update -Cq
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   254
  $ rm test.orig
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   255
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   256
make sure that commits aren't possible if working directory is not pointing to active bookmark
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   257
  $ hg -R ../a status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   258
  $ hg -R ../b status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   259
  $ hg -R ../a id -i
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   260
  36a6e592ec06
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   261
  $ hg -R ../a book | grep X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   262
   \* X                         \d+:36a6e592ec06 (re)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   263
  $ hg -R ../b id -i
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   264
  36a6e592ec06
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   265
  $ hg -R ../b book | grep X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   266
   \* X                         \d+:36a6e592ec06 (re)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   267
  $ make_changes ../a
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   268
  $ hg -R ../a book | grep X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   269
   \* X                         \d+:f73a71c992b8 (re)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   270
  $ cd ../b
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   271
  $ hg pull  2>&1 | grep -v add | grep -v pulling | grep -v searching | grep -v changeset
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   272
  updating bookmark X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   273
  (run 'hg update' to get a working copy)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   274
  working directory out of sync with active bookmark, run 'hg up X'
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   275
  $ hg id -i # we're still on the old commit
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   276
  36a6e592ec06
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   277
  $ hg book | grep X # while the bookmark moved
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   278
   \* X                         \d+:f73a71c992b8 (re)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   279
  $ make_changes
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   280
  abort: cannot commit, working directory out of sync with active bookmark
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   281
  (run 'hg up X')
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   282
  [255]
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   283
  $ hg up -Cq -r .  # cleanup local changes
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   284
  $ hg status
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   285
  $ hg id -i # we're still on the old commit
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   286
  36a6e592ec06
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   287
  $ hg up X -q
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   288
  $ hg id -i # now we're on X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   289
  f73a71c992b8
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   290
  $ hg book | grep X
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   291
   \* X                         \d+:f73a71c992b8 (re)
9cec7a36bab8 bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff changeset
   292