tests/test-import-merge.t
author Anton Shestakov <engored@ya.ru>
Mon, 22 Sep 2014 23:46:38 +0900
branchstable
changeset 22506 6e1fbcb18a75
parent 22303 0c838e7459a5
child 22305 bdc0e04df243
permissions -rw-r--r--
hgweb: fail if an invalid command was supplied in url path (issue4071) Traditionally, the way to specify a command for hgweb was to use url query arguments (e.g. "?cmd=batch"). If the command is unknown to hgweb, it gives an error (e.g. "400 no such method: badcmd"). But there's also another way to specify a command: as a url path fragment (e.g. "/graph"). Before, hgweb was made forgiving (looks like it was made in 44c5157474e7) and user could put any unknown command in the url. If hgweb couldn't understand it, it would just silently fall back to the default command, which depends on the actual style (e.g. for paper it's shortlog, for monoblue it's summary). This was inconsistent and was breaking some tools that rely on http status codes (as noted in the issue4071). So this patch changes that behavior to the more consistent one, i.e. hgweb will now return "400 no such method: badcmd". So if some tool was relying on having an invalid command return http status code 200 and also have some information, then it will stop working. That is, if somebody typed foobar when they really meant shortlog (and the user was lucky enough to choose a style where the default command is shortlog too), that fact will now be revealed. Code-wise, the changed if block is only relevant when there's no "?cmd" query parameter (i.e. only when command is specified as a url path fragment), and looks like the removed else branch was there only for falling back to default command. With that removed, the rest of the code works as expected: it looks at the command, and if it's not known, raises a proper ErrorResponse exception with an appropriate message. Evidently, there were no tests that required the old behavior. But, frankly, I don't know any way to tell if anyone actually exploited such forgiving behavior in some in-house tool.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15511
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
  $ echo "[extensions]" >> $HGRCPATH
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
  $ echo "mq=" >> $HGRCPATH
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     4
  $ tipparents() {
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     5
  > hg parents --template "{rev}:{node|short} {desc|firstline}\n" -r tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     6
  > }
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     8
Test import and merge diffs
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    10
  $ hg init repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
  $ cd repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    12
  $ echo a > a
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    13
  $ hg ci -Am adda
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    14
  adding a
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    15
  $ echo a >> a
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    16
  $ hg ci -m changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    17
  $ echo c > c
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    18
  $ hg ci -Am addc
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    19
  adding c
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    20
  $ hg up 0
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    21
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    22
  $ echo b > b
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    23
  $ hg ci -Am addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    24
  adding b
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    25
  created new head
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    26
  $ hg up 1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    27
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    28
  $ hg merge 3
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    29
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    30
  (branch merge, don't forget to commit)
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    31
  $ hg ci -m merge
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    32
  $ hg export . > ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    33
  $ cd ..
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    34
  $ hg clone -r2 repo repo2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    35
  adding changesets
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    36
  adding manifests
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    37
  adding file changes
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    38
  added 3 changesets with 3 changes to 2 files
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    39
  updating to branch default
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    40
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    41
  $ cd repo2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    42
  $ hg pull -r3 ../repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    43
  pulling from ../repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    44
  searching for changes
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    45
  adding changesets
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    46
  adding manifests
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    47
  adding file changes
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    48
  added 1 changesets with 1 changes to 1 files (+1 heads)
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    49
  (run 'hg heads' to see heads, 'hg merge' to merge)
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    50
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    51
Test without --exact and diff.p1 == workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    52
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    53
  $ hg up 1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    54
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    55
  $ hg import ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    56
  applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    57
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    58
  1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    59
  3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    60
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    61
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    62
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    63
Test without --exact and diff.p1 != workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    64
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    65
  $ hg up 2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    66
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    67
  $ hg import ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    68
  applying ../merge.diff
22303
0c838e7459a5 import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    69
  warning: import the patch as a normal revision
0c838e7459a5 import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    70
  (use --exact to import the patch as a merge)
15511
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    71
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    72
  2:890ecaa90481 addc
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    73
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    74
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    75
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    76
Test with --exact
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    77
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    78
  $ hg import --exact ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    79
  applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    80
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    81
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    82
  1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    83
  3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    84
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    85
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    86
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    87
Test with --bypass and diff.p1 == workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    88
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    89
  $ hg up 1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    90
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    91
  $ hg import --bypass ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    92
  applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    93
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    94
  1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    95
  3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    96
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    97
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    98
Test with --bypass and diff.p1 != workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    99
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   100
  $ hg up 2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   101
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   102
  $ hg import --bypass ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   103
  applying ../merge.diff
22303
0c838e7459a5 import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
   104
  warning: import the patch as a normal revision
0c838e7459a5 import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
   105
  (use --exact to import the patch as a merge)
15511
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   106
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   107
  2:890ecaa90481 addc
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   108
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   109
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   110
Test with --bypass and --exact
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   111
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   112
  $ hg import --bypass --exact ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   113
  applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   114
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   115
  1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   116
  3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   117
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   118
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15511
diff changeset
   119
  $ cd ..
18656
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   120
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   121
Test that --exact on a bad header doesn't corrupt the repo (issue3616)
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   122
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   123
  $ hg init repo3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   124
  $ cd repo3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   125
  $ echo a>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   126
  $ hg ci -Aqm0
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   127
  $ echo a>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   128
  $ hg ci -m1
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   129
  $ echo a>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   130
  $ hg ci -m2
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   131
  $ echo a>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   132
  $ echo b>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   133
  $ echo a>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   134
  $ hg ci -m3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   135
  $ hg export 2 | head -7 > ../a.patch
19628
3193b23eec61 solaris: tests can't use tail -n
Danek Duvall <danek.duvall@oracle.com>
parents: 18656
diff changeset
   136
  $ hg export tip > out
20303
3a3731a60354 test-import-merge: mangle file in binary mode
Matt Mackall <mpm@selenic.com>
parents: 19628
diff changeset
   137
  >>> apatch = open("../a.patch", "ab")
19628
3193b23eec61 solaris: tests can't use tail -n
Danek Duvall <danek.duvall@oracle.com>
parents: 18656
diff changeset
   138
  >>> apatch.write("".join(open("out").readlines()[7:]))
18656
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   139
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   140
  $ cd ..
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   141
  $ hg clone -qr0 repo3 repo3-clone
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   142
  $ cd repo3-clone
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   143
  $ hg pull -qr1 ../repo3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   144
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   145
  $ hg import --exact ../a.patch
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   146
  applying ../a.patch
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   147
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   148
  patching file a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   149
  Hunk #1 succeeded at 1 with fuzz 1 (offset -1 lines).
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   150
  transaction abort!
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   151
  rollback completed
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   152
  abort: patch is damaged or loses information
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   153
  [255]
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   154
  $ hg verify
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   155
  checking changesets
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   156
  checking manifests
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   157
  crosschecking files in changesets and manifests
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   158
  checking files
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   159
  1 files, 2 changesets, 2 total revisions