tests/test-bookmarks-merge.t
author Bryan O'Sullivan <bryano@fb.com>
Tue, 18 Sep 2012 16:25:20 -0700
changeset 17618 7840d81a80ec
parent 17394 19e4861f9730
child 18122 730b769fb634
permissions -rw-r--r--
store: use native fncache encoding function if available This currently falls back to Python for hashed encoding.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16706
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
     1
# init
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
     2
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
     3
  $ hg init
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
     4
  $ echo a > a
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
     5
  $ hg add a
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
     6
  $ hg commit -m'a'
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
     7
  $ echo b > b
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
     8
  $ hg add b
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
     9
  $ hg commit -m'b'
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    10
  $ hg up -C 0
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    11
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    12
  $ echo c > c
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    13
  $ hg add c
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    14
  $ hg commit -m'c'
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    15
  created new head
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    16
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    17
# test merging of diverged bookmarks
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    18
  $ hg bookmark -r 1 "c@diverge"
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    19
  $ hg bookmark -r 1 b
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    20
  $ hg bookmark c
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    21
  $ hg bookmarks
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    22
     b                         1:d2ae7f538514
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    23
   * c                         2:d36c0562f908
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    24
     c@diverge                 1:d2ae7f538514
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    25
  $ hg merge "c@diverge"
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    26
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    27
  (branch merge, don't forget to commit)
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    28
  $ hg commit -m'merge'
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    29
  $ hg bookmarks
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    30
     b                         1:d2ae7f538514
a270ec977ba6 bookmarks: delete divergent bookmarks on merge
David Soria Parra <dsp@php.net>
parents:
diff changeset
    31
   * c                         3:b8f96cf4688b
16708
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    32
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    33
  $ hg up -C 3
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    34
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    35
  $ echo d > d
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    36
  $ hg add d
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    37
  $ hg commit -m'd'
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    38
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    39
  $ hg up -C 3
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    40
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    41
  $ echo e > e
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    42
  $ hg add e
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    43
  $ hg commit -m'e'
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    44
  created new head
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    45
  $ hg up -C 5
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    46
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    47
  $ hg bookmark e
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    48
  $ hg bookmarks
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    49
     b                         1:d2ae7f538514
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    50
     c                         3:b8f96cf4688b
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    51
   * e                         5:26bee9c5bcf3
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    52
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    53
# the picked side is bookmarked
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    54
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    55
  $ hg up -C 4
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    56
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    57
  $ hg merge
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    58
  abort: heads are bookmarked - please merge with an explicit rev
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    59
  (run 'hg heads' to see all heads)
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    60
  [255]
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    61
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    62
# our revision is bookmarked
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    63
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    64
  $ hg up -C e
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    65
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    66
  $ hg merge
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    67
  abort: no matching bookmark to merge - please merge with an explicit rev or bookmark
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    68
  (run 'hg heads' to see all heads)
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    69
  [255]
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    70
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    71
# merge bookmark heads
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    72
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    73
  $ hg up -C 4
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    74
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    75
  $ echo f > f
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    76
  $ hg commit -Am "f"
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    77
  adding f
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    78
  $ hg up -C e
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    79
  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    80
  $ hg bookmarks -r 4 "e@diverged"
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    81
  $ hg bookmarks
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    82
     b                         1:d2ae7f538514
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    83
     c                         3:b8f96cf4688b
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    84
   * e                         5:26bee9c5bcf3
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    85
     e@diverged                4:a0546fcfe0fb
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    86
  $ hg merge
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    87
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    88
  (branch merge, don't forget to commit)
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    89
  $ hg commit -m'merge'
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    90
  $ hg bookmarks
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    91
     b                         1:d2ae7f538514
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    92
     c                         3:b8f96cf4688b
4a02cf4fbb2e merge: respect bookmarks during merge
David Soria Parra <dsp@php.net>
parents: 16706
diff changeset
    93
   * e                         7:ca784329f0ba
17394
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
    94
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
    95
# test warning when all heads are inactive bookmarks
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
    96
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
    97
  $ hg up -C 6
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
    98
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
    99
  $ echo g > g
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   100
  $ hg commit -Am 'g'
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   101
  adding g
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   102
  $ hg bookmark -i g
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   103
  $ hg bookmarks
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   104
     b                         1:d2ae7f538514
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   105
     c                         3:b8f96cf4688b
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   106
     e                         7:ca784329f0ba
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   107
     g                         8:04dd21731d95
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   108
  $ hg heads
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   109
  changeset:   8:04dd21731d95
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   110
  bookmark:    g
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   111
  tag:         tip
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   112
  parent:      6:be381d1126a0
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   113
  user:        test
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   114
  date:        Thu Jan 01 00:00:00 1970 +0000
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   115
  summary:     g
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   116
  
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   117
  changeset:   7:ca784329f0ba
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   118
  bookmark:    e
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   119
  parent:      5:26bee9c5bcf3
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   120
  parent:      4:a0546fcfe0fb
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   121
  user:        test
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   122
  date:        Thu Jan 01 00:00:00 1970 +0000
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   123
  summary:     merge
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   124
  
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   125
  $ hg merge
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   126
  abort: heads are bookmarked - please merge with an explicit rev
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   127
  (run 'hg heads' to see all heads)
19e4861f9730 tests: merging bookmarked heads
John Li <jli@circularly.org>
parents: 16708
diff changeset
   128
  [255]