tests/test-merge1.t
author Augie Fackler <augie@google.com>
Tue, 20 Jan 2015 13:38:07 -0500
changeset 24018 26d6a6a78c1d
parent 19802 94c394653b2a
child 25111 1ef96a3b8b89
permissions -rw-r--r--
obsolete: use parsers.fm1readmarker if it exists for a ~38% perf win This moves perfloadmarkers on my linux workstation (63494 markers from mpm, crew, and myself) performance from ! wall 0.357657 comb 0.360000 user 0.350000 sys 0.010000 (best of 28) to ! wall 0.222345 comb 0.220000 user 0.210000 sys 0.010000 (best of 41) which is a pretty good improvement. On my BSD machine, which is ancient and slow, before: ! wall 3.584964 comb 3.578125 user 3.539062 sys 0.039062 (best of 3) after: ! wall 2.267974 comb 2.265625 user 2.195312 sys 0.070312 (best of 5) I feel like we could do better by moving the whole generator function into C, but I didn't want to tackle that right away.
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
19482
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    26
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    27
Test interrupted updates by exploiting our non-handling of directory collisions
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    28
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    29
  $ mkdir b
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    30
  $ hg up
19498
3ac1735a2265 tests: glob out exception type for directory collision
Matt Mackall <mpm@selenic.com>
parents: 19482
diff changeset
    31
  abort: *: '$TESTTMP/t/b' (glob)
19482
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    32
  [255]
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    33
  $ hg ci
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    34
  abort: last update was interrupted
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    35
  (use 'hg update' to get a consistent checkout)
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    36
  [255]
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    37
  $ hg sum
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    38
  parent: 0:538afb845929 
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    39
   commit #0
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    40
  branch: default
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    41
  commit: (interrupted update)
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    42
  update: 1 new changesets (update)
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    43
  $ rmdir b
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    44
  $ hg up
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    45
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    46
  $ hg sum
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    47
  parent: 1:b8bb4a988f25 tip
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    48
   commit #1
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    49
  branch: default
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    50
  commit: (clean)
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    51
  update: (current)
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    52
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    53
Prepare a basic merge
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    54
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    55
  $ hg up 0
499fc471296b update: add tracking of interrupted updates (issue3113)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
    56
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    57
  $ echo This is file c1 > c
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    58
  $ hg add c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    59
  $ hg commit -m "commit #2"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    60
  created new head
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    61
  $ echo This is file b1 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    62
no merges expected
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    63
  $ hg merge -P 1
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    64
  changeset:   1:b8bb4a988f25
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    65
  user:        test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    66
  date:        Thu Jan 01 00:00:00 1970 +0000
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    67
  summary:     commit #1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    68
  
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    69
  $ hg merge 1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    70
  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
    71
  (branch merge, don't forget to commit)
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    72
  $ hg diff --nodates
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    73
  diff -r 49035e18a8e6 b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    74
  --- /dev/null
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    75
  +++ b/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    76
  @@ -0,0 +1,1 @@
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    77
  +This is file b1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    78
  $ hg status
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    79
  M b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    80
  $ cd ..; rm -r t
407
0e0d0670b2bc [PATCH] Merging identical changes from another branch
mpm@selenic.com
parents:
diff changeset
    81
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 13439
diff changeset
    82
  $ hg init t
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    83
  $ cd t
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    84
  $ echo This is file a1 > a
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    85
  $ hg add a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    86
  $ hg commit -m "commit #0"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    87
  $ echo This is file b1 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    88
  $ hg add b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    89
  $ hg commit -m "commit #1"
407
0e0d0670b2bc [PATCH] Merging identical changes from another branch
mpm@selenic.com
parents:
diff changeset
    90
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    91
  $ hg update 0
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    92
  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
    93
  $ echo This is file c1 > c
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    94
  $ hg add c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
    95
  $ hg commit -m "commit #2"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    96
  created new head
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    97
  $ echo This is file b2 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    98
merge should fail
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
    99
  $ hg merge 1
15894
44fa047cef57 merge: report all files in _checkunknown
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15619
diff changeset
   100
  b: untracked file differs
44fa047cef57 merge: report all files in _checkunknown
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15619
diff changeset
   101
  abort: untracked files in working directory differ from files in requested revision
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   102
  [255]
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   103
merge of b expected
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   104
  $ hg merge -f 1
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 12664
diff changeset
   105
  merging b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   106
  merging for b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   107
  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
   108
  (branch merge, don't forget to commit)
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   109
  $ hg diff --nodates
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   110
  diff -r 49035e18a8e6 b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   111
  --- /dev/null
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   112
  +++ b/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   113
  @@ -0,0 +1,1 @@
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   114
  +This is file b2
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   115
  $ hg status
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   116
  M b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   117
  $ cd ..; rm -r t
407
0e0d0670b2bc [PATCH] Merging identical changes from another branch
mpm@selenic.com
parents:
diff changeset
   118
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 13439
diff changeset
   119
  $ hg init t
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   120
  $ cd t
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   121
  $ echo This is file a1 > a
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   122
  $ hg add a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   123
  $ hg commit -m "commit #0"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   124
  $ echo This is file b1 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   125
  $ hg add b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   126
  $ hg commit -m "commit #1"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   127
  $ echo This is file b22 > b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   128
  $ hg commit -m "commit #2"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   129
  $ hg update 1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   130
  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
   131
  $ echo This is file c1 > c
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   132
  $ hg add c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   133
  $ hg commit -m "commit #3"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   134
  created new head
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   135
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   136
Contents of b should be "this is file b1"
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   137
  $ cat b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   138
  This is file b1
1236
67a28636ea64 Fix bug with co -C across branches, update tests
mpm@selenic.com
parents: 814
diff changeset
   139
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   140
  $ echo This is file b22 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   141
merge fails
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   142
  $ hg merge 2
19802
94c394653b2a merge: standardize error message for dirty working dir
Siddharth Agarwal <sid0@fb.com>
parents: 19498
diff changeset
   143
  abort: uncommitted changes
15619
6c8573dd1b6b merge: make 'nothing to merge' aborts consistent
Kevin Bullock <kbullock@ringworld.org>
parents: 15243
diff changeset
   144
  (use 'hg status' to list changes)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   145
  [255]
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13956
diff changeset
   146
merge expected!
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   147
  $ hg merge -f 2
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   148
  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
   149
  (branch merge, don't forget to commit)
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   150
  $ hg diff --nodates
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   151
  diff -r 85de557015a8 b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   152
  --- a/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   153
  +++ b/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   154
  @@ -1,1 +1,1 @@
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   155
  -This is file b1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   156
  +This is file b22
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   157
  $ hg status
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   158
  M b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   159
  $ cd ..; rm -r t
407
0e0d0670b2bc [PATCH] Merging identical changes from another branch
mpm@selenic.com
parents:
diff changeset
   160
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 13439
diff changeset
   161
  $ hg init t
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   162
  $ cd t
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   163
  $ echo This is file a1 > a
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   164
  $ hg add a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   165
  $ hg commit -m "commit #0"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   166
  $ echo This is file b1 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   167
  $ hg add b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   168
  $ hg commit -m "commit #1"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   169
  $ echo This is file b22 > b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   170
  $ hg commit -m "commit #2"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   171
  $ hg update 1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   172
  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
   173
  $ echo This is file c1 > c
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   174
  $ hg add c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   175
  $ hg commit -m "commit #3"
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   176
  created new head
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   177
  $ echo This is file b33 > b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   178
merge of b should fail
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   179
  $ hg merge 2
19802
94c394653b2a merge: standardize error message for dirty working dir
Siddharth Agarwal <sid0@fb.com>
parents: 19498
diff changeset
   180
  abort: uncommitted changes
15619
6c8573dd1b6b merge: make 'nothing to merge' aborts consistent
Kevin Bullock <kbullock@ringworld.org>
parents: 15243
diff changeset
   181
  (use 'hg status' to list changes)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   182
  [255]
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   183
merge of b expected
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   184
  $ hg merge -f 2
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 12664
diff changeset
   185
  merging b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   186
  merging for b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   187
  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
   188
  (branch merge, don't forget to commit)
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   189
  $ hg diff --nodates
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11975
diff changeset
   190
  diff -r 85de557015a8 b
11975
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   191
  --- a/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   192
  +++ b/b
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   193
  @@ -1,1 +1,1 @@
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   194
  -This is file b1
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   195
  +This is file b33
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   196
  $ hg status
21884b433c51 tests: unify test-merge1
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8834
diff changeset
   197
  M b
12664
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   198
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   199
Test for issue2364
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   200
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   201
  $ hg up -qC .
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   202
  $ hg rm b
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   203
  $ hg ci -md
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   204
  $ hg revert -r -2 b
545ec1775021 merge: handle no file parent in backwards merge (issue2364)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   205
  $ hg up -q -- -2
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15894
diff changeset
   206
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15894
diff changeset
   207
  $ cd ..