tests/test-push-warn.t
author Adrian Buehlmann <adrian@cadifra.com>
Tue, 14 Sep 2010 12:20:51 +0200
changeset 12279 28e2e3804f2e
parent 12156 tests/test-push-warn@4c94b6d0fb1c
child 12316 4134686b83e1
permissions -rwxr-xr-x
combine tests
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     1
  $ echo "[extensions]" >> $HGRCPATH
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     2
  $ echo "graphlog=" >> $HGRCPATH
816
8674b7803714 Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff changeset
     3
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     4
  $ mkdir a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     5
  $ cd a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     6
  $ hg init
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     7
  $ echo foo > t1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     8
  $ hg add t1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     9
  $ hg commit -m "1"
10875
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
    10
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    11
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    12
  $ hg clone a b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    13
  updating to branch default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    14
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    15
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    16
  $ cd a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    17
  $ echo foo > t2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    18
  $ hg add t2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    19
  $ hg commit -m "2"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    20
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    21
  $ cd ../b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    22
  $ echo foo > t3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    23
  $ hg add t3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    24
  $ hg commit -m "3"
816
8674b7803714 Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff changeset
    25
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    26
  $ hg push ../a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    27
  pushing to ../a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    28
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    29
  abort: push creates new remote heads on branch 'default'!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    30
  (you should pull and merge or use push -f to force)
816
8674b7803714 Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff changeset
    31
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    32
  $ hg pull ../a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    33
  pulling from ../a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    34
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    35
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    36
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    37
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    38
  added 1 changesets with 1 changes to 1 files (+1 heads)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    39
  (run 'hg heads' to see heads, 'hg merge' to merge)
816
8674b7803714 Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff changeset
    40
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    41
  $ hg push ../a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    42
  pushing to ../a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    43
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    44
  abort: push creates new remote heads on branch 'default'!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    45
  (did you forget to merge? use push -f to force)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    46
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    47
  $ hg merge
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    48
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    49
  (branch merge, don't forget to commit)
816
8674b7803714 Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff changeset
    50
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    51
  $ hg commit -m "4"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    52
  $ hg push ../a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    53
  pushing to ../a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    54
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    55
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    56
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    57
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    58
  added 2 changesets with 1 changes to 1 files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    59
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    60
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    61
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    62
  $ hg init c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    63
  $ cd c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    64
  $ for i in 0 1 2; do
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    65
  >     echo $i >> foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    66
  >     hg ci -Am $i
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    67
  > done
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    68
  adding foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    69
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    70
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    71
  $ hg clone c d
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    72
  updating to branch default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    73
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2021
fc22ed56afe3 Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1933
diff changeset
    74
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    75
  $ cd d
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    76
  $ for i in 0 1; do
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    77
  >    hg co -C $i
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    78
  >    echo d-$i >> foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    79
  >    hg ci -m d-$i
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    80
  > done
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    81
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    82
  created new head
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    83
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    84
  created new head
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    85
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    86
  $ HGMERGE=true hg merge 3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    87
  merging foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    88
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    89
  (branch merge, don't forget to commit)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    90
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    91
  $ hg ci -m c-d
2021
fc22ed56afe3 Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1933
diff changeset
    92
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    93
  $ hg push ../c; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    94
  pushing to ../c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    95
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    96
  abort: push creates new remote heads on branch 'default'!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    97
  (did you forget to merge? use push -f to force)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    98
  255
2021
fc22ed56afe3 Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1933
diff changeset
    99
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   100
  $ hg push -r 2 ../c; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   101
  pushing to ../c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   102
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   103
  no changes found
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   104
  0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   105
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   106
  $ hg push -r 3 ../c; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   107
  pushing to ../c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   108
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   109
  abort: push creates new remote heads on branch 'default'!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   110
  (did you forget to merge? use push -f to force)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   111
  255
2021
fc22ed56afe3 Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1933
diff changeset
   112
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   113
  $ hg push -r 3 -r 4 ../c; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   114
  pushing to ../c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   115
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   116
  abort: push creates new remote heads on branch 'default'!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   117
  (did you forget to merge? use push -f to force)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   118
  255
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   119
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   120
  $ hg push -f -r 3 -r 4 ../c; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   121
  pushing to ../c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   122
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   123
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   124
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   125
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   126
  added 2 changesets with 2 changes to 1 files (+2 heads)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   127
  0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   128
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   129
  $ hg push -r 5 ../c; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   130
  pushing to ../c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   131
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   132
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   133
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   134
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   135
  added 1 changesets with 1 changes to 1 files (-1 heads)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   136
  0
2021
fc22ed56afe3 Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1933
diff changeset
   137
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   138
  $ hg in ../c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   139
  comparing with ../c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   140
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   141
  no changes found
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   142
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   143
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   144
Issue 450:
3923
27230c29bfec fix calculation of new heads added during push with -r
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3803
diff changeset
   145
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   146
  $ hg init ../e
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   147
  $ hg push -r 0 ../e ; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   148
  pushing to ../e
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   149
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   150
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   151
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   152
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   153
  added 1 changesets with 1 changes to 1 files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   154
  0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   155
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   156
  $ hg push -r 1 ../e ; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   157
  pushing to ../e
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   158
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   159
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   160
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   161
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   162
  added 1 changesets with 1 changes to 1 files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   163
  0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   164
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   165
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   166
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   167
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   168
Issue 736:
8565
268d16b2ec25 tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents: 3923
diff changeset
   169
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   170
  $ hg init f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   171
  $ cd f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   172
  $ hg -q branch a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   173
  $ echo 0 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   174
  $ hg -q ci -Am 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   175
  $ echo 1 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   176
  $ hg -q ci -m 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   177
  $ hg -q up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   178
  $ echo 2 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   179
  $ hg -q ci -m 2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   180
  $ hg -q up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   181
  $ hg -q branch b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   182
  $ echo 3 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   183
  $ hg -q ci -m 3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   184
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   185
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   186
  $ hg -q clone f g
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   187
  $ cd g
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   188
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   189
Push on existing branch and new branch:
8565
268d16b2ec25 tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents: 3923
diff changeset
   190
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   191
  $ hg -q up 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   192
  $ echo 4 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   193
  $ hg -q ci -m 4
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   194
  $ hg -q up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   195
  $ echo 5 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   196
  $ hg -q branch c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   197
  $ hg -q ci -m 5
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   198
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   199
  $ hg push ../f; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   200
  pushing to ../f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   201
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   202
  abort: push creates new remote branches: c!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   203
  (use 'hg push --new-branch' to create new remote branches)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   204
  255
8565
268d16b2ec25 tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents: 3923
diff changeset
   205
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   206
  $ hg push -r 4 -r 5 ../f; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   207
  pushing to ../f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   208
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   209
  abort: push creates new remote branches: c!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   210
  (use 'hg push --new-branch' to create new remote branches)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   211
  255
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   212
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   213
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   214
Multiple new branches:
8565
268d16b2ec25 tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents: 3923
diff changeset
   215
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   216
  $ hg -q branch d
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   217
  $ echo 6 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   218
  $ hg -q ci -m 6
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   219
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   220
  $ hg push ../f; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   221
  pushing to ../f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   222
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   223
  abort: push creates new remote branches: c, d!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   224
  (use 'hg push --new-branch' to create new remote branches)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   225
  255
10354
844d83da2da9 prepush: warn about every new outgoing named branch, not just the first
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 9954
diff changeset
   226
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   227
  $ hg push -r 4 -r 6 ../f; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   228
  pushing to ../f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   229
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   230
  abort: push creates new remote branches: c, d!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   231
  (use 'hg push --new-branch' to create new remote branches)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   232
  255
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   233
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   234
  $ cd ../g
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   235
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   236
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   237
Fail on multiple head push:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   238
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   239
  $ hg -q up 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   240
  $ echo 7 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   241
  $ hg -q ci -m 7
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   242
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   243
  $ hg push -r 4 -r 7 ../f; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   244
  pushing to ../f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   245
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   246
  abort: push creates new remote heads on branch 'a'!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   247
  (did you forget to merge? use push -f to force)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   248
  255
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   249
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   250
Push replacement head on existing branches:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   251
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   252
  $ hg -q up 3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   253
  $ echo 8 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   254
  $ hg -q ci -m 8
8565
268d16b2ec25 tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents: 3923
diff changeset
   255
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   256
  $ hg push -r 7 -r 8 ../f; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   257
  pushing to ../f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   258
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   259
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   260
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   261
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   262
  added 2 changesets with 2 changes to 1 files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   263
  0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   264
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   265
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   266
Merge of branch a to other branch b followed by unrelated push
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   267
on branch a:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   268
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   269
  $ hg -q up 7
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   270
  $ HGMERGE=true hg -q merge 8
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   271
  $ hg -q ci -m 9
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   272
  $ hg -q up 8
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   273
  $ echo 10 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   274
  $ hg -q ci -m 10
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   275
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   276
  $ hg push -r 9 ../f; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   277
  pushing to ../f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   278
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   279
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   280
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   281
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   282
  added 1 changesets with 1 changes to 1 files (-1 heads)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   283
  0
8565
268d16b2ec25 tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents: 3923
diff changeset
   284
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   285
  $ hg push -r 10 ../f; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   286
  pushing to ../f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   287
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   288
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   289
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   290
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   291
  added 1 changesets with 1 changes to 1 files (+1 heads)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   292
  0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   293
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   294
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   295
Cheating the counting algorithm:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   296
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   297
  $ hg -q up 9
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   298
  $ HGMERGE=true hg -q merge 2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   299
  $ hg -q ci -m 11
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   300
  $ hg -q up 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   301
  $ echo 12 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   302
  $ hg -q ci -m 12
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   303
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   304
  $ hg push -r 11 -r 12 ../f; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   305
  pushing to ../f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   306
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   307
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   308
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   309
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   310
  added 2 changesets with 2 changes to 1 files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   311
  0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   312
8565
268d16b2ec25 tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents: 3923
diff changeset
   313
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   314
Failed push of new named branch:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   315
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   316
  $ echo 12 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   317
  $ hg -q ci -m 12a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   318
  $ hg -q up 11
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   319
  $ echo 13 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   320
  $ hg -q branch e
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   321
  $ hg -q ci -m 13d
8565
268d16b2ec25 tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents: 3923
diff changeset
   322
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   323
  $ hg push -r 12 -r 13 ../f; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   324
  pushing to ../f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   325
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   326
  abort: push creates new remote branches: e!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   327
  (use 'hg push --new-branch' to create new remote branches)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   328
  255
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   329
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   330
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   331
Using --new-branch to push new named branch:
11211
e43c23d189a5 push: add --new-branch option to allow intial push of new branches
Sune Foldager <cryo@cyanite.org>
parents: 10925
diff changeset
   332
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   333
  $ hg push --new-branch -r 12 -r 13 ../f; echo $?
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   334
  pushing to ../f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   335
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   336
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   337
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   338
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   339
  added 1 changesets with 1 changes to 1 files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   340
  0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   341
11211
e43c23d189a5 push: add --new-branch option to allow intial push of new branches
Sune Foldager <cryo@cyanite.org>
parents: 10925
diff changeset
   342
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   343
Checking prepush logic does not allow silently pushing 
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   344
multiple new heads:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   345
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   346
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   347
  $ hg init h
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   348
  $ echo init > h/init
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   349
  $ hg -R h ci -Am init
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   350
  adding init
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   351
  $ echo a > h/a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   352
  $ hg -R h ci -Am a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   353
  adding a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   354
  $ hg clone h i
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   355
  updating to branch default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   356
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   357
  $ hg -R h up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   358
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   359
  $ echo b > h/b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   360
  $ hg -R h ci -Am b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   361
  adding b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   362
  created new head
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   363
  $ hg -R i up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   364
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   365
  $ echo c > i/c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   366
  $ hg -R i ci -Am c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   367
  adding c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   368
  created new head
9479
f3569d95c2ab push: fix subtle bug in prepush logic
Sune Foldager <cryo@cyanite.org>
parents: 8565
diff changeset
   369
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   370
  $ hg -R i push h
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   371
  pushing to h
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   372
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   373
  abort: push creates new remote heads on branch 'default'!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   374
  (you should pull and merge or use push -f to force)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   375
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   376
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   377
Check prepush logic with merged branches:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   378
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   379
  $ hg init j
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   380
  $ hg -R j branch a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   381
  marked working directory as branch a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   382
  $ echo init > j/foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   383
  $ hg -R j ci -Am init
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   384
  adding foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   385
  $ hg clone j k
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   386
  updating to branch a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   387
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   388
  $ echo a1 > j/foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   389
  $ hg -R j ci -m a1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   390
  $ hg -R k branch b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   391
  marked working directory as branch b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   392
  $ echo b > k/foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   393
  $ hg -R k ci -m b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   394
  $ hg -R k up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   395
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   396
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   397
  $ hg -R k merge b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   398
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   399
  (branch merge, don't forget to commit)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   400
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   401
  $ hg -R k ci -m merge
9954
d6a307719ccb fix bug in prepush logic involving merge changesets
Sune Foldager <cryo@cyanite.org>
parents: 9609
diff changeset
   402
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   403
  $ hg -R k push -r a j
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   404
  pushing to j
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   405
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   406
  abort: push creates new remote branches: b!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   407
  (use 'hg push --new-branch' to create new remote branches)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   408
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   409
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   410
Prepush -r should not allow you to sneak in new heads:
10875
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   411
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   412
  $ hg init l
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   413
  $ cd l
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   414
  $ echo a >> foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   415
  $ hg -q add foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   416
  $ hg -q branch a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   417
  $ hg -q ci -ma
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   418
  $ hg -q up null
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   419
  $ echo a >> foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   420
  $ hg -q add foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   421
  $ hg -q branch b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   422
  $ hg -q ci -mb
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   423
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   424
  $ hg -q clone l m -u a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   425
  $ cd m
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   426
  $ hg -q merge b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   427
  $ hg -q ci -mmb
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   428
  $ hg -q up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   429
  $ echo a >> foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   430
  $ hg -q ci -ma2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   431
  $ hg -q up 2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   432
  $ echo a >> foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   433
  $ hg -q branch -f b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   434
  $ hg -q ci -mb2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   435
  $ hg -q merge 3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   436
  $ hg -q ci -mma
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   437
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   438
  $ hg push ../l -b b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   439
  pushing to ../l
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   440
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   441
  abort: push creates new remote heads on branch 'a'!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   442
  (did you forget to merge? use push -f to force)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   443
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   444
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   445
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   446
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   447
Check prepush with new branch head on former topo non-head:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   448
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   449
  $ hg init n
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   450
  $ cd n
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   451
  $ hg branch A
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   452
  marked working directory as branch A
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   453
  $ echo a >a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   454
  $ hg ci -Ama
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   455
  adding a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   456
  $ hg branch B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   457
  marked working directory as branch B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   458
  $ echo b >b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   459
  $ hg ci -Amb
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   460
  adding b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   461
10875
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   462
# b is now branch head of B, and a topological head
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   463
# a is now branch head of A, but not a topological head
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   464
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   465
  $ hg clone . inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   466
  updating to branch B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   467
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   468
  $ cd inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   469
  $ hg up B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   470
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   471
  $ echo b1 >b1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   472
  $ hg ci -Amb1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   473
  adding b1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   474
10875
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   475
# in the clone b1 is now the head of B
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   476
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   477
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   478
  $ hg up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   479
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   480
  $ echo a2 >a2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   481
  $ hg ci -Ama2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   482
  adding a2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   483
10875
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   484
# a2 is now the new branch head of A, and a new topological head
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   485
# it replaces a former inner branch head, so it should at most warn about A, not B
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   486
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   487
glog of local:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   488
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   489
  $ hg glog --template "{rev}: {branches} {desc}\n"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   490
  @  2: A a2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   491
  |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   492
  | o  1: B b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   493
  |/
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   494
  o  0: A a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   495
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   496
glog of remote:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   497
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   498
  $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   499
  @  2: B b1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   500
  |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   501
  o  1: B b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   502
  |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   503
  o  0: A a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   504
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   505
outgoing:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   506
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   507
  $ hg out inner --template "{rev}: {branches} {desc}\n"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   508
  comparing with inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   509
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   510
  2: A a2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   511
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   512
  $ hg push inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   513
  pushing to inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   514
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   515
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   516
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   517
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   518
  added 1 changesets with 1 changes to 1 files (+1 heads)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   519
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   520
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   521
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   522
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   523
Check prepush with new branch head on former topo head:
10875
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   524
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   525
  $ hg init o
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   526
  $ cd o
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   527
  $ hg branch A
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   528
  marked working directory as branch A
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   529
  $ echo a >a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   530
  $ hg ci -Ama
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   531
  adding a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   532
  $ hg branch B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   533
  marked working directory as branch B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   534
  $ echo b >b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   535
  $ hg ci -Amb
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   536
  adding b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   537
10875
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   538
# b is now branch head of B, and a topological head
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   539
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   540
  $ hg up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   541
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   542
  $ echo a1 >a1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   543
  $ hg ci -Ama1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   544
  adding a1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   545
10875
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   546
# a1 is now branch head of A, and a topological head
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   547
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   548
  $ hg clone . inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   549
  updating to branch A
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   550
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   551
  $ cd inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   552
  $ hg up B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   553
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   554
  $ echo b1 >b1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   555
  $ hg ci -Amb1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   556
  adding b1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   557
10875
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   558
# in the clone b1 is now the head of B
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   559
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   560
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   561
  $ echo a2 >a2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   562
  $ hg ci -Ama2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   563
  adding a2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   564
10875
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   565
# a2 is now the new branch head of A, and a topological head
a9702c47a19f partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents: 10771
diff changeset
   566
# it replaces a former topological and branch head, so this should not warn
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   567
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   568
glog of local:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   569
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   570
  $ hg glog --template "{rev}: {branches} {desc}\n"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   571
  @  3: A a2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   572
  |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   573
  o  2: A a1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   574
  |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   575
  | o  1: B b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   576
  |/
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   577
  o  0: A a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   578
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   579
glog of remote:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   580
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   581
  $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   582
  @  3: B b1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   583
  |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   584
  | o  2: A a1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   585
  | |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   586
  o |  1: B b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   587
  |/
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   588
  o  0: A a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   589
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   590
outgoing:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   591
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   592
  $ hg out inner --template "{rev}: {branches} {desc}\n"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   593
  comparing with inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   594
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   595
  3: A a2
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   596
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   597
  $ hg push inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   598
  pushing to inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   599
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   600
  adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   601
  adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   602
  adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   603
  added 1 changesets with 1 changes to 1 files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   604
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   605
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   606
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   607
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   608
Check prepush with new branch head and new child of former branch head
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   609
but child is on different branch:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   610
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   611
  $ hg init p
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   612
  $ cd p
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   613
  $ hg branch A
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   614
  marked working directory as branch A
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   615
  $ echo a0 >a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   616
  $ hg ci -Ama0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   617
  adding a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   618
  $ echo a1 >a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   619
  $ hg ci -ma1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   620
  $ hg up null
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   621
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   622
  $ hg branch B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   623
  marked working directory as branch B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   624
  $ echo b0 >b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   625
  $ hg ci -Amb0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   626
  adding b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   627
  $ echo b1 >b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   628
  $ hg ci -mb1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   629
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   630
  $ hg clone . inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   631
  updating to branch B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   632
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
10771
01f097c4ae66 push: fix bug in prepush logic and its tests
Sune Foldager <cryo@cyanite.org>
parents: 10354
diff changeset
   633
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   634
  $ hg up A
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   635
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   636
  $ hg branch -f B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   637
  marked working directory as branch B
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   638
  $ echo a3 >a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   639
  $ hg ci -ma3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   640
  created new head
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   641
  $ hg up 3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   642
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   643
  $ hg branch -f A
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   644
  marked working directory as branch A
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   645
  $ echo b3 >b
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   646
  $ hg ci -mb3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   647
  created new head
10909
29a83fb8c067 prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 10908
diff changeset
   648
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   649
glog of local:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   650
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   651
  $ hg glog --template "{rev}: {branches} {desc}\n"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   652
  @  5: A b3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   653
  |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   654
  | o  4: B a3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   655
  | |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   656
  o |  3: B b1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   657
  | |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   658
  o |  2: B b0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   659
   /
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   660
  o  1: A a1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   661
  |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   662
  o  0: A a0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   663
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   664
glog of remote:
10909
29a83fb8c067 prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 10908
diff changeset
   665
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   666
  $ hg glog -R inner --template "{rev}: {branches} {desc}\n"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   667
  @  3: B b1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   668
  |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   669
  o  2: B b0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   670
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   671
  o  1: A a1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   672
  |
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   673
  o  0: A a0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   674
  
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   675
outgoing:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   676
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   677
  $ hg out inner --template "{rev}: {branches} {desc}\n"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   678
  comparing with inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   679
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   680
  4: B a3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   681
  5: A b3
10909
29a83fb8c067 prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 10908
diff changeset
   682
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   683
  $ hg push inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   684
  pushing to inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   685
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   686
  abort: push creates new remote heads on branch 'A'!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   687
  (did you forget to merge? use push -f to force)
10909
29a83fb8c067 prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 10908
diff changeset
   688
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   689
  $ hg push inner -r4 -r5
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   690
  pushing to inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   691
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   692
  abort: push creates new remote heads on branch 'A'!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   693
  (did you forget to merge? use push -f to force)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   694
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   695
  $ hg in inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   696
  comparing with inner
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   697
  searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   698
  no changes found
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   699
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   700
  $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   701