tests/test-merge1.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Sat, 24 Dec 2011 19:05:35 +0900
branchstable
changeset 15723 1581da01d5c4
parent 15243 1e9451476bf8
child 15619 6c8573dd1b6b
permissions -rw-r--r--
windows: use normalized path as path to subrepo path to subrepo is used to identify or check location of subrepo. it should be normalized (in "/" delimiter form), because it is also used with narrowmatcher which uses only normalized path even on Windows environment. this patch applies "util.pconvert()" on path to subrepo (called "subpath") to normalize it. for this patch, referers of below were checked. - subrepo.state() - subrepo.itersubrepos() - subrepo.subrepo() - context.sub() - context.substate() typical usecase is: for subpath in ctx.substate: sub = ctx.sub(subpath) ... ctx.substate[subpath] .... in this case, normalization has no side effect, because keys given from substate are used as key itself. other cases shown below also seem to require subpath to be normalized. - path components are joined by "/", in "commands.forget()": for subpath in ctx.substate: subforget[subpath + '/' + fsub] = (fsub, sub) - normalized "file" is used to check below condition, in "commands.revert()", "localrepository.commit()", and "localrepository._checknested()" file in ctx.substate - substate.keys() is passed to dirstate.walk()/status() which use only normalized pathes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
     1
  $ cat <<EOF > merge
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
     2
  > import sys, os
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
     3
  > 
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
     4
  > try:
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
     5
  >     import msvcrt
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
     6
  >     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
     7
  >     msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
     8
  > except ImportError:
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
     9
  >     pass
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    10
  > 
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    11
  > print "merging for", os.path.basename(sys.argv[1])
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    12
  > EOF
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    13
  $ HGMERGE="python ../merge"; export HGMERGE
7080
a6477aa893b8 tests: Windows compatibility fixes
Patrick Mezard <pmezard@gmail.com>
parents: 4294
diff changeset
    14
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 13439
diff changeset
    15
  $ hg init t
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    16
  $ cd t
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    17
  $ echo This is file a1 > a
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    18
  $ hg add a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    19
  $ hg commit -m "commit #0"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    20
  $ echo This is file b1 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    21
  $ hg add b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    22
  $ hg commit -m "commit #1"
407
0e0d0670b2bc [PATCH] Merging identical changes from another branch
mpm@selenic.com
parents:
diff changeset
    23
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    24
  $ hg update 0
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    25
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    26
  $ echo This is file c1 > c
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    27
  $ hg add c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    28
  $ hg commit -m "commit #2"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    29
  created new head
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    30
  $ echo This is file b1 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    31
no merges expected
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    32
  $ hg merge -P 1
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    33
  changeset:   1:b8bb4a988f25
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    34
  user:        test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    35
  date:        Thu Jan 01 00:00:00 1970 +0000
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    36
  summary:     commit #1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    37
  
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    38
  $ hg merge 1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    39
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    40
  (branch merge, don't forget to commit)
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    41
  $ hg diff --nodates
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    42
  diff -r 49035e18a8e6 b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    43
  --- /dev/null
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    44
  +++ b/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    45
  @@ -0,0 +1,1 @@
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    46
  +This is file b1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    47
  $ hg status
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    48
  M b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    49
  $ cd ..; rm -r t
407
0e0d0670b2bc [PATCH] Merging identical changes from another branch
mpm@selenic.com
parents:
diff changeset
    50
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 13439
diff changeset
    51
  $ hg init t
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    52
  $ cd t
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    53
  $ echo This is file a1 > a
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    54
  $ hg add a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    55
  $ hg commit -m "commit #0"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    56
  $ echo This is file b1 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    57
  $ hg add b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    58
  $ hg commit -m "commit #1"
407
0e0d0670b2bc [PATCH] Merging identical changes from another branch
mpm@selenic.com
parents:
diff changeset
    59
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    60
  $ hg update 0
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    61
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    62
  $ echo This is file c1 > c
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    63
  $ hg add c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    64
  $ hg commit -m "commit #2"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    65
  created new head
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    66
  $ echo This is file b2 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    67
merge should fail
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    68
  $ hg merge 1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    69
  abort: untracked file in working directory differs from file in requested revision: 'b'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    70
  [255]
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    71
merge of b expected
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    72
  $ hg merge -f 1
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 12664
diff changeset
    73
  merging b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    74
  merging for b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    75
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    76
  (branch merge, don't forget to commit)
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    77
  $ hg diff --nodates
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    78
  diff -r 49035e18a8e6 b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    79
  --- /dev/null
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    80
  +++ b/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    81
  @@ -0,0 +1,1 @@
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    82
  +This is file b2
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    83
  $ hg status
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    84
  M b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    85
  $ cd ..; rm -r t
407
0e0d0670b2bc [PATCH] Merging identical changes from another branch
mpm@selenic.com
parents:
diff changeset
    86
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 13439
diff changeset
    87
  $ hg init t
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    88
  $ cd t
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    89
  $ echo This is file a1 > a
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    90
  $ hg add a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    91
  $ hg commit -m "commit #0"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    92
  $ echo This is file b1 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    93
  $ hg add b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    94
  $ hg commit -m "commit #1"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    95
  $ echo This is file b22 > b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    96
  $ hg commit -m "commit #2"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    97
  $ hg update 1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    98
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    99
  $ echo This is file c1 > c
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   100
  $ hg add c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   101
  $ hg commit -m "commit #3"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   102
  created new head
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   103
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   104
Contents of b should be "this is file b1"
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   105
  $ cat b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   106
  This is file b1
1236
67a28636ea64 Fix bug with co -C across branches, update tests
mpm@selenic.com
parents: 814
diff changeset
   107
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   108
  $ echo This is file b22 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   109
merge fails
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   110
  $ hg merge 2
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   111
  abort: outstanding uncommitted changes (use 'hg status' to list changes)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   112
  [255]
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13956
diff changeset
   113
merge expected!
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   114
  $ hg merge -f 2
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   115
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   116
  (branch merge, don't forget to commit)
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   117
  $ hg diff --nodates
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   118
  diff -r 85de557015a8 b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   119
  --- a/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   120
  +++ b/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   121
  @@ -1,1 +1,1 @@
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   122
  -This is file b1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   123
  +This is file b22
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   124
  $ hg status
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   125
  M b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   126
  $ cd ..; rm -r t
407
0e0d0670b2bc [PATCH] Merging identical changes from another branch
mpm@selenic.com
parents:
diff changeset
   127
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 13439
diff changeset
   128
  $ hg init t
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   129
  $ cd t
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   130
  $ echo This is file a1 > a
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   131
  $ hg add a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   132
  $ hg commit -m "commit #0"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   133
  $ echo This is file b1 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   134
  $ hg add b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   135
  $ hg commit -m "commit #1"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   136
  $ echo This is file b22 > b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   137
  $ hg commit -m "commit #2"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   138
  $ hg update 1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   139
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   140
  $ echo This is file c1 > c
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   141
  $ hg add c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   142
  $ hg commit -m "commit #3"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   143
  created new head
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   144
  $ echo This is file b33 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   145
merge of b should fail
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   146
  $ hg merge 2
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   147
  abort: outstanding uncommitted changes (use 'hg status' to list changes)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   148
  [255]
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   149
merge of b expected
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   150
  $ hg merge -f 2
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 12664
diff changeset
   151
  merging b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   152
  merging for b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   153
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   154
  (branch merge, don't forget to commit)
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   155
  $ hg diff --nodates
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   156
  diff -r 85de557015a8 b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   157
  --- a/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   158
  +++ b/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   159
  @@ -1,1 +1,1 @@
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   160
  -This is file b1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   161
  +This is file b33
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   162
  $ hg status
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   163
  M b
12664
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   164
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   165
Test for issue2364
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   166
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   167
  $ hg up -qC .
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   168
  $ hg rm b
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   169
  $ hg ci -md
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   170
  $ hg revert -r -2 b
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   171
  $ hg up -q -- -2