tests/test-sharing.t
author Laurent Charignon <lcharignon@fb.com>
Tue, 23 Jun 2015 13:20:00 -0700
changeset 1419 b54524ae77c0
parent 1404 848a04c078c7
child 1450 5f6e78aea094
permissions -rw-r--r--
evolve: fix an issue in the documentation of the evolve function hg evolve is solving troubles that will become children of the parent of the working copy and its descendant. This last part was omitted by mistake from the help message before.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
     1
Test script based on sharing.rst: ensure that all scenarios in that
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
     2
document work as advertised.
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
     3
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
     4
Setting things up
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
     5
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
     6
  $ cat >> $HGRCPATH <<EOF
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
     7
  > [alias]
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
     8
  > shortlog = log --template '{rev}:{node|short}  {phase}  {desc|firstline}\n'
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
     9
  > [extensions]
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    10
  > rebase =
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    11
  > EOF
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    12
  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    13
  $ hg init public
1259
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    14
  $ hg clone public test-repo
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    15
  updating to branch default
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    16
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    17
  $ hg clone test-repo dev-repo
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    18
  updating to branch default
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    19
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    20
  $ cat >> test-repo/.hg/hgrc <<EOF
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    21
  > [phases]
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    22
  > publish = false
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    23
  > EOF
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    24
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    25
To start things off, let's make one public, immutable changeset::
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    26
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    27
  $ cd test-repo
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    28
  $ echo 'my new project' > file1
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    29
  $ hg add file1
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    30
  $ hg commit -m'create new project'
1259
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    31
  $ hg push
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    32
  pushing to $TESTTMP/public
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    33
  searching for changes
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    34
  adding changesets
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    35
  adding manifests
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    36
  adding file changes
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    37
  added 1 changesets with 1 changes to 1 files
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    38
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    39
and pull that into the development repository::
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    40
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    41
  $ cd ../dev-repo
1259
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    42
  $ hg pull -u
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    43
  pulling from $TESTTMP/test-repo
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    44
  requesting all changes
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    45
  adding changesets
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    46
  adding manifests
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    47
  adding file changes
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    48
  added 1 changesets with 1 changes to 1 files
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
    49
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    50
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    51
Let's commit a preliminary change and push it to ``test-repo`` for
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    52
testing. ::
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    53
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    54
  $ echo 'fix fix fix' > file1
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    55
  $ hg commit -m'prelim change'
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    56
  $ hg push -q ../test-repo
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    57
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    58
Figure SG01 (roughly)
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    59
  $ hg shortlog -G
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    60
  @  1:f6490818a721  draft  prelim change
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    61
  |
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    62
  o  0:0dc9c9f6ab91  public  create new project
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    63
  
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    64
Now let's switch to test-repo to test our change and amend::
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    65
  $ cd ../test-repo
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    66
  $ hg update -q
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    67
  $ echo 'Fix fix fix.' > file1
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    68
  $ hg amend -m'fix bug 37'
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    69
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    70
Figure SG02
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    71
  $ hg shortlog --hidden -G
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    72
  @  3:60ffde5765c5  draft  fix bug 37
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    73
  |
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    74
  | x  2:2a039763c0f4  draft  temporary amend commit for f6490818a721
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    75
  | |
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    76
  | x  1:f6490818a721  draft  prelim change
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    77
  |/
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    78
  o  0:0dc9c9f6ab91  public  create new project
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    79
  
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    80
Pull into dev-repo: obsolescence markers are transferred, but not
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    81
the new obsolete changeset.
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    82
  $ cd ../dev-repo
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
    83
  $ hg pull -u
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
    84
  pulling from $TESTTMP/test-repo
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
    85
  searching for changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
    86
  adding changesets
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
    87
  adding manifests
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
    88
  adding file changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
    89
  added 1 changesets with 1 changes to 1 files (+1 heads)
1356
aff6bc2a6b2d test: adapt to change in mercurial core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1265
diff changeset
    90
  2 new obsolescence markers
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
    91
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    92
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    93
Figure SG03
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    94
  $ hg shortlog --hidden -G
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    95
  @  2:60ffde5765c5  draft  fix bug 37
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    96
  |
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    97
  | x  1:f6490818a721  draft  prelim change
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    98
  |/
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
    99
  o  0:0dc9c9f6ab91  public  create new project
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   100
  
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   101
Amend again in dev-repo
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   102
  $ echo 'Fix, fix, and fix.' > file1
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   103
  $ hg amend
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   104
  $ hg push -q
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   105
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   106
Figure SG04 (dev-repo)
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   107
  $ hg shortlog --hidden -G
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   108
  @  4:de6151c48e1c  draft  fix bug 37
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   109
  |
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   110
  | x  3:ad19d3570adb  draft  temporary amend commit for 60ffde5765c5
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   111
  | |
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   112
  | x  2:60ffde5765c5  draft  fix bug 37
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   113
  |/
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   114
  | x  1:f6490818a721  draft  prelim change
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   115
  |/
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   116
  o  0:0dc9c9f6ab91  public  create new project
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   117
  
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   118
Figure SG04 (test-repo)
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   119
  $ cd ../test-repo
1259
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   120
  $ hg update
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   121
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   122
  $ hg shortlog --hidden -G
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   123
  @  4:de6151c48e1c  draft  fix bug 37
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   124
  |
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   125
  | x  3:60ffde5765c5  draft  fix bug 37
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   126
  |/
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   127
  | x  2:2a039763c0f4  draft  temporary amend commit for f6490818a721
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   128
  | |
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   129
  | x  1:f6490818a721  draft  prelim change
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   130
  |/
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   131
  o  0:0dc9c9f6ab91  public  create new project
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   132
  
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   133
This bug fix is finished. We can push it to the public repository.
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   134
  $ hg push
1110
875e671c3cd8 test: add glob annotations where Mercurial's run-tests.py suggests
Matt Harbison <matt_harbison@yahoo.com>
parents: 1099
diff changeset
   135
  pushing to $TESTTMP/public (glob)
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   136
  searching for changes
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   137
  adding changesets
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   138
  adding manifests
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   139
  adding file changes
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   140
  added 1 changesets with 1 changes to 1 files
1356
aff6bc2a6b2d test: adapt to change in mercurial core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1265
diff changeset
   141
  4 new obsolescence markers
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   142
1263
eb0a1d1d499b docs: sharing guide: clarify end-game of "Example 2"
Greg Ward <greg@gerg.ca>
parents: 1261
diff changeset
   143
Now that the fix is public, we cannot amend it any more.
eb0a1d1d499b docs: sharing guide: clarify end-game of "Example 2"
Greg Ward <greg@gerg.ca>
parents: 1261
diff changeset
   144
  $ hg amend -m 'fix bug 37'
eb0a1d1d499b docs: sharing guide: clarify end-game of "Example 2"
Greg Ward <greg@gerg.ca>
parents: 1261
diff changeset
   145
  abort: cannot amend public changesets
eb0a1d1d499b docs: sharing guide: clarify end-game of "Example 2"
Greg Ward <greg@gerg.ca>
parents: 1261
diff changeset
   146
  [255]
eb0a1d1d499b docs: sharing guide: clarify end-game of "Example 2"
Greg Ward <greg@gerg.ca>
parents: 1261
diff changeset
   147
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   148
Figure SG05
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   149
  $ hg -R ../public shortlog -G
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   150
  o  1:de6151c48e1c  public  fix bug 37
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   151
  |
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   152
  o  0:0dc9c9f6ab91  public  create new project
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   153
  
1263
eb0a1d1d499b docs: sharing guide: clarify end-game of "Example 2"
Greg Ward <greg@gerg.ca>
parents: 1261
diff changeset
   154
Oops, still have draft changesets in dev-repo: push the phase change there.
eb0a1d1d499b docs: sharing guide: clarify end-game of "Example 2"
Greg Ward <greg@gerg.ca>
parents: 1261
diff changeset
   155
  $ hg -R ../dev-repo shortlog -r 'draft()'
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   156
  4:de6151c48e1c  draft  fix bug 37
1263
eb0a1d1d499b docs: sharing guide: clarify end-game of "Example 2"
Greg Ward <greg@gerg.ca>
parents: 1261
diff changeset
   157
  $ hg push ../dev-repo
eb0a1d1d499b docs: sharing guide: clarify end-game of "Example 2"
Greg Ward <greg@gerg.ca>
parents: 1261
diff changeset
   158
  pushing to ../dev-repo
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   159
  searching for changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   160
  no changes found
1263
eb0a1d1d499b docs: sharing guide: clarify end-game of "Example 2"
Greg Ward <greg@gerg.ca>
parents: 1261
diff changeset
   161
  [1]
eb0a1d1d499b docs: sharing guide: clarify end-game of "Example 2"
Greg Ward <greg@gerg.ca>
parents: 1261
diff changeset
   162
  $ hg -R ../dev-repo shortlog -r 'draft()'
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   163
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   164
Sharing with multiple developers: code review
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   165
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   166
  $ cd ..
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   167
  $ hg clone public review
1259
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   168
  updating to branch default
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   169
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   170
  $ hg clone review alice
1259
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   171
  updating to branch default
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   172
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   173
  $ hg clone review bob
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   174
  updating to branch default
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   175
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   176
  $ cat >> review/.hg/hgrc <<EOF
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   177
  > [phases]
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   178
  > publish = false
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   179
  > EOF
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   180
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   181
Alice commits a draft bug fix, pushes to review repo.
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   182
  $ cd alice
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   183
  $ hg bookmark bug15
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   184
  $ echo 'fix' > file2
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   185
  $ hg commit -A -u alice -m 'fix bug 15 (v1)'
1259
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   186
  adding file2
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   187
  $ hg push -B bug15
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   188
  pushing to $TESTTMP/review
1259
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   189
  searching for changes
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   190
  adding changesets
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   191
  adding manifests
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   192
  adding file changes
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   193
  added 1 changesets with 1 changes to 1 files
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   194
  exporting bookmark bug15
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   195
  $ hg -R ../review bookmarks
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   196
     bug15                     2:f91e97234c2b
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   197
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   198
Alice receives code review, amends her fix, and goes out to lunch to
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   199
await second review.
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   200
  $ echo 'Fix.' > file2
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   201
  $ hg amend -m 'fix bug 15 (v2)'
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   202
  $ hg push
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   203
  pushing to $TESTTMP/review
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   204
  searching for changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   205
  adding changesets
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   206
  adding manifests
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   207
  adding file changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   208
  added 1 changesets with 1 changes to 1 files (+1 heads)
1356
aff6bc2a6b2d test: adapt to change in mercurial core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1265
diff changeset
   209
  2 new obsolescence markers
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   210
  updating bookmark bug15
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   211
  $ hg -R ../review bookmarks
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   212
     bug15                     3:cbdfbd5a5db2
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   213
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   214
Figure SG06: review repository after Alice pushes her amended changeset.
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   215
  $ hg --hidden -R ../review shortlog -G -r 1::
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   216
  o  3:cbdfbd5a5db2  draft  fix bug 15 (v2)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   217
  |
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   218
  | x  2:f91e97234c2b  draft  fix bug 15 (v1)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   219
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   220
  @  1:de6151c48e1c  public  fix bug 37
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   221
  |
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   222
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   223
Bob commits a draft changeset, pushes to review repo.
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   224
  $ cd ../bob
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   225
  $ echo 'stuff' > file1
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   226
  $ hg bookmark featureX
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   227
  $ hg commit -u bob -m 'implement feature X (v1)'
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   228
  $ hg push -B featureX
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   229
  pushing to $TESTTMP/review
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   230
  searching for changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   231
  remote has heads on branch 'default' that are not known locally: cbdfbd5a5db2
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   232
  adding changesets
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   233
  adding manifests
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   234
  adding file changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   235
  added 1 changesets with 1 changes to 1 files (+1 heads)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   236
  exporting bookmark featureX
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   237
  $ hg -R ../review bookmarks
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   238
     bug15                     3:cbdfbd5a5db2
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   239
     featureX                  4:193657d1e852
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   240
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   241
Bob receives first review, amends and pushes.
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   242
  $ echo 'do stuff' > file1
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   243
  $ hg amend -m 'implement feature X (v2)'
1259
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   244
  $ hg push
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   245
  pushing to $TESTTMP/review
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   246
  searching for changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   247
  remote has heads on branch 'default' that are not known locally: cbdfbd5a5db2
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   248
  adding changesets
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   249
  adding manifests
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   250
  adding file changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   251
  added 1 changesets with 1 changes to 1 files (+1 heads)
1356
aff6bc2a6b2d test: adapt to change in mercurial core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1265
diff changeset
   252
  2 new obsolescence markers
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   253
  updating bookmark featureX
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   254
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   255
Bob receives second review, amends, and pushes to public:
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   256
this time, he's sure he got it right!
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   257
  $ echo 'Do stuff.' > file1
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   258
  $ hg amend -m 'implement feature X (v3)'
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   259
  $ hg push ../public
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   260
  pushing to ../public
1259
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   261
  searching for changes
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   262
  adding changesets
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   263
  adding manifests
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   264
  adding file changes
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   265
  added 1 changesets with 1 changes to 1 files
1356
aff6bc2a6b2d test: adapt to change in mercurial core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1265
diff changeset
   266
  4 new obsolescence markers
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   267
  $ hg -R ../public bookmarks
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   268
  no bookmarks set
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   269
  $ hg push ../review
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   270
  pushing to ../review
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   271
  searching for changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   272
  remote has heads on branch 'default' that are not known locally: cbdfbd5a5db2
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   273
  adding changesets
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   274
  adding manifests
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   275
  adding file changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   276
  added 1 changesets with 1 changes to 1 files (+1 heads)
1356
aff6bc2a6b2d test: adapt to change in mercurial core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1265
diff changeset
   277
  2 new obsolescence markers
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   278
  updating bookmark featureX
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   279
  $ hg -R ../review bookmarks
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   280
     bug15                     3:cbdfbd5a5db2
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   281
     featureX                  6:540ba8f317e6
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   282
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   283
Figure SG07: review and public repos after Bob implements feature X.
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   284
  $ hg --hidden -R ../review shortlog -G -r 1::
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   285
  o  6:540ba8f317e6  public  implement feature X (v3)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   286
  |
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   287
  | x  5:0eb74a7b6698  draft  implement feature X (v2)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   288
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   289
  | x  4:193657d1e852  draft  implement feature X (v1)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   290
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   291
  | o  3:cbdfbd5a5db2  draft  fix bug 15 (v2)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   292
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   293
  | x  2:f91e97234c2b  draft  fix bug 15 (v1)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   294
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   295
  @  1:de6151c48e1c  public  fix bug 37
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   296
  |
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   297
  $ hg --hidden -R ../public shortlog -G -r 1::
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   298
  o  2:540ba8f317e6  public  implement feature X (v3)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   299
  |
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   300
  o  1:de6151c48e1c  public  fix bug 37
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   301
  |
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   302
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   303
How do things look in the review repo?
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   304
  $ cd ../review
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   305
  $ hg --hidden shortlog -G -r 1::
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   306
  o  6:540ba8f317e6  public  implement feature X (v3)
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   307
  |
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   308
  | x  5:0eb74a7b6698  draft  implement feature X (v2)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   309
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   310
  | x  4:193657d1e852  draft  implement feature X (v1)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   311
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   312
  | o  3:cbdfbd5a5db2  draft  fix bug 15 (v2)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   313
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   314
  | x  2:f91e97234c2b  draft  fix bug 15 (v1)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   315
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   316
  @  1:de6151c48e1c  public  fix bug 37
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   317
  |
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   318
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   319
Meantime, Alice is back from lunch. While she was away, Bob approved
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   320
her change, so now she can publish it.
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   321
  $ cd ../alice
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   322
  $ hg --hidden shortlog -G -r 1::
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   323
  @  4:cbdfbd5a5db2  draft  fix bug 15 (v2)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   324
  |
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   325
  | x  3:55dd95168a35  draft  temporary amend commit for f91e97234c2b
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   326
  | |
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   327
  | x  2:f91e97234c2b  draft  fix bug 15 (v1)
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   328
  |/
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   329
  o  1:de6151c48e1c  public  fix bug 37
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   330
  |
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   331
  $ hg outgoing -q ../public
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   332
  4:cbdfbd5a5db2
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   333
  $ hg push ../public
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   334
  pushing to ../public
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   335
  searching for changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   336
  remote has heads on branch 'default' that are not known locally: 540ba8f317e6
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   337
  abort: push creates new remote head cbdfbd5a5db2 with bookmark 'bug15'!
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   338
  (pull and merge or see "hg help push" for details about pushing new heads)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   339
  [255]
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   340
  $ hg pull ../public
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   341
  pulling from ../public
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   342
  searching for changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   343
  adding changesets
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   344
  adding manifests
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   345
  adding file changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   346
  added 1 changesets with 1 changes to 1 files (+1 heads)
1356
aff6bc2a6b2d test: adapt to change in mercurial core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1265
diff changeset
   347
  4 new obsolescence markers
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   348
  (run 'hg heads' to see heads, 'hg merge' to merge)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   349
  $ hg log -G -q -r 'head()'
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   350
  o  5:540ba8f317e6
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   351
  |
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   352
  | @  4:cbdfbd5a5db2
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   353
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   354
  $ hg --hidden shortlog -G -r 1::
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   355
  o  5:540ba8f317e6  public  implement feature X (v3)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   356
  |
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   357
  | @  4:cbdfbd5a5db2  draft  fix bug 15 (v2)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   358
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   359
  | x  3:55dd95168a35  draft  temporary amend commit for f91e97234c2b
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   360
  | |
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   361
  | x  2:f91e97234c2b  draft  fix bug 15 (v1)
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   362
  |/
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   363
  o  1:de6151c48e1c  public  fix bug 37
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   364
  |
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   365
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   366
Alice rebases her draft changeset on top of Bob's public changeset and
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   367
publishes the result.
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   368
  $ hg rebase -d 5
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   369
  rebasing 4:cbdfbd5a5db2 "fix bug 15 (v2)" (bug15)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   370
  $ hg push ../public
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   371
  pushing to ../public
1259
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   372
  searching for changes
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   373
  adding changesets
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   374
  adding manifests
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   375
  adding file changes
0daf56a2032d docs: update sharing guide based (mostly) on marmoute's review
Greg Ward <greg@gerg.ca>
parents: 1130
diff changeset
   376
  added 1 changesets with 1 changes to 1 files
1356
aff6bc2a6b2d test: adapt to change in mercurial core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1265
diff changeset
   377
  3 new obsolescence markers
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   378
  $ hg push ../review
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   379
  pushing to ../review
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   380
  searching for changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   381
  adding changesets
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   382
  adding manifests
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   383
  adding file changes
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   384
  added 1 changesets with 0 changes to 1 files
1356
aff6bc2a6b2d test: adapt to change in mercurial core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1265
diff changeset
   385
  1 new obsolescence markers
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   386
  updating bookmark bug15
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   387
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   388
Figure SG08: review and public changesets after Alice pushes.
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   389
  $ hg --hidden -R ../review shortlog -G -r 1::
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   390
  o  7:a06ec1bf97bd  public  fix bug 15 (v2)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   391
  |
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   392
  o  6:540ba8f317e6  public  implement feature X (v3)
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   393
  |
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   394
  | x  5:0eb74a7b6698  draft  implement feature X (v2)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   395
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   396
  | x  4:193657d1e852  draft  implement feature X (v1)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   397
  |/
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   398
  | x  3:cbdfbd5a5db2  draft  fix bug 15 (v2)
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   399
  |/
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   400
  | x  2:f91e97234c2b  draft  fix bug 15 (v1)
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   401
  |/
1261
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   402
  @  1:de6151c48e1c  public  fix bug 37
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   403
  |
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   404
  $ hg --hidden -R ../public shortlog -G -r 1::
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   405
  o  3:a06ec1bf97bd  public  fix bug 15 (v2)
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   406
  |
56cc2eb5995a docs: add code review scenario to sharing guide
Greg Ward <greg@gerg.ca>
parents: 1259
diff changeset
   407
  o  2:540ba8f317e6  public  implement feature X (v3)
979
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   408
  |
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   409
  o  1:de6151c48e1c  public  fix bug 37
c7b2ccd99dab docs: add guide to sharing mutable history
Greg Ward <greg@gerg.ca>
parents:
diff changeset
   410
  |
1265
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   411
  $ cd ..
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   412
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   413
Setup for "cowboy mode" shared mutable history (to illustrate divergent
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   414
and bumped changesets).
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   415
  $ rm -rf review alice bob
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   416
  $ hg clone public alice
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   417
  updating to branch default
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   418
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   419
  $ hg clone public bob
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   420
  updating to branch default
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   421
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   422
  $ cat >> alice/.hg/hgrc <<EOF
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   423
  > [phases]
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   424
  > publish = false
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   425
  > EOF
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   426
  $ cp alice/.hg/hgrc bob/.hg/hgrc
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   427
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   428
Now we'll have Bob commit a bug fix that could still be improved::
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   429
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   430
  $ cd bob
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   431
  $ echo 'pretty good fix' >> file1
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   432
  $ hg commit -u bob -m 'fix bug 24 (v1)'
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   433
  $ hg shortlog -r .
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   434
  4:2fe6c4bd32d0  draft  fix bug 24 (v1)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   435
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   436
Since Alice and Bob are now in cowboy mode, Alice pulls Bob's draft
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   437
changeset and amends it herself. ::
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   438
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   439
  $ cd ../alice
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   440
  $ hg pull -u ../bob
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   441
  pulling from ../bob
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   442
  searching for changes
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   443
  adding changesets
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   444
  adding manifests
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   445
  adding file changes
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   446
  added 1 changesets with 1 changes to 1 files
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   447
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   448
  $ echo 'better fix (alice)' >> file1
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   449
  $ hg amend -u alice -m 'fix bug 24 (v2 by alice)'
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   450
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   451
Bob implements a better fix of his own::
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   452
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   453
  $ cd ../bob
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   454
  $ echo 'better fix (bob)' >> file1
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   455
  $ hg amend -u bob -m 'fix bug 24 (v2 by bob)'
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   456
  $ hg --hidden shortlog -G -r 3::
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   457
  @  6:a360947f6faf  draft  fix bug 24 (v2 by bob)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   458
  |
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   459
  | x  5:3466c7f5a149  draft  temporary amend commit for 2fe6c4bd32d0
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   460
  | |
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   461
  | x  4:2fe6c4bd32d0  draft  fix bug 24 (v1)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   462
  |/
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   463
  o  3:a06ec1bf97bd  public  fix bug 15 (v2)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   464
  |
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   465
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   466
Bob discovers the divergence.
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   467
  $ hg pull ../alice
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   468
  pulling from ../alice
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   469
  searching for changes
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   470
  adding changesets
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   471
  adding manifests
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   472
  adding file changes
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   473
  added 1 changesets with 1 changes to 1 files (+1 heads)
1356
aff6bc2a6b2d test: adapt to change in mercurial core
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1265
diff changeset
   474
  2 new obsolescence markers
1265
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   475
  (run 'hg heads' to see heads, 'hg merge' to merge)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   476
  2 new divergent changesets
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   477
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   478
Figure SG09: multiple heads! divergence! oh my!
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   479
  $ hg --hidden shortlog -G -r 3::
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   480
  o  7:e3f99ce9d9cd  draft  fix bug 24 (v2 by alice)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   481
  |
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   482
  | @  6:a360947f6faf  draft  fix bug 24 (v2 by bob)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   483
  |/
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   484
  | x  5:3466c7f5a149  draft  temporary amend commit for 2fe6c4bd32d0
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   485
  | |
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   486
  | x  4:2fe6c4bd32d0  draft  fix bug 24 (v1)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   487
  |/
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   488
  o  3:a06ec1bf97bd  public  fix bug 15 (v2)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   489
  |
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   490
  $ hg --hidden shortlog -r 'successors(2fe6)'
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   491
  6:a360947f6faf  draft  fix bug 24 (v2 by bob)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   492
  7:e3f99ce9d9cd  draft  fix bug 24 (v2 by alice)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   493
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   494
Use evolve to fix the divergence.
1404
848a04c078c7 evolve: add selector for trouble types
Laurent Charignon <lcharignon@fb.com>
parents: 1356
diff changeset
   495
  $ HGMERGE=internal:other hg evolve --divergent
1265
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   496
  merge:[6] fix bug 24 (v2 by bob)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   497
  with: [7] fix bug 24 (v2 by alice)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   498
  base: [4] fix bug 24 (v1)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   499
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   500
  working directory is now at 5ad6037c046c
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   501
  $ hg log -q -r 'divergent()'
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   502
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   503
Figure SG10: Bob's repository after fixing divergence.
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   504
  $ hg --hidden shortlog -G -r 3::
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   505
  @  9:5ad6037c046c  draft  fix bug 24 (v2 by bob)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   506
  |
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   507
  | x  8:bcfc9a755ac3  draft  temporary amend commit for a360947f6faf
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   508
  | |
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   509
  +---x  7:e3f99ce9d9cd  draft  fix bug 24 (v2 by alice)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   510
  | |
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   511
  | x  6:a360947f6faf  draft  fix bug 24 (v2 by bob)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   512
  |/
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   513
  | x  5:3466c7f5a149  draft  temporary amend commit for 2fe6c4bd32d0
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   514
  | |
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   515
  | x  4:2fe6c4bd32d0  draft  fix bug 24 (v1)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   516
  |/
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   517
  o  3:a06ec1bf97bd  public  fix bug 15 (v2)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   518
  |
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   519
  $ hg --hidden shortlog -r 'precursors(9)'
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   520
  6:a360947f6faf  draft  fix bug 24 (v2 by bob)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   521
  7:e3f99ce9d9cd  draft  fix bug 24 (v2 by alice)
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   522
  $ cat file1
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   523
  Do stuff.
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   524
  pretty good fix
14f91037d2f6 docs: revive the explanation of divergent changesets in the sharing guide
Greg Ward <greg@gerg.ca>
parents: 1263
diff changeset
   525
  better fix (alice)