Show More
@@ -1,89 +1,90 b'' | |||
|
1 | 1 | $ cat > patchtool.py <<EOF |
|
2 | > from __future__ import absolute_import, print_function | |
|
2 | 3 | > import sys |
|
3 |
> print |
|
|
4 | > print('Using custom patch') | |
|
4 | 5 | > if '--binary' in sys.argv: |
|
5 |
> print |
|
|
6 | > print('--binary found !') | |
|
6 | 7 | > EOF |
|
7 | 8 | |
|
8 | 9 | $ echo "[ui]" >> $HGRCPATH |
|
9 | 10 | $ echo "patch=$PYTHON ../patchtool.py" >> $HGRCPATH |
|
10 | 11 | |
|
11 | 12 | $ hg init a |
|
12 | 13 | $ cd a |
|
13 | 14 | $ echo a > a |
|
14 | 15 | $ hg commit -Ama -d '1 0' |
|
15 | 16 | adding a |
|
16 | 17 | $ echo b >> a |
|
17 | 18 | $ hg commit -Amb -d '2 0' |
|
18 | 19 | $ cd .. |
|
19 | 20 | |
|
20 | 21 | This test checks that: |
|
21 | 22 | - custom patch commands with arguments actually work |
|
22 | 23 | - patch code does not try to add weird arguments like |
|
23 | 24 | --binary when custom patch commands are used. For instance |
|
24 | 25 | --binary is added by default under win32. |
|
25 | 26 | |
|
26 | 27 | check custom patch options are honored |
|
27 | 28 | |
|
28 | 29 | $ hg --cwd a export -o ../a.diff tip |
|
29 | 30 | $ hg clone -r 0 a b |
|
30 | 31 | adding changesets |
|
31 | 32 | adding manifests |
|
32 | 33 | adding file changes |
|
33 | 34 | added 1 changesets with 1 changes to 1 files |
|
34 | 35 | updating to branch default |
|
35 | 36 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
36 | 37 | |
|
37 | 38 | $ hg --cwd b import -v ../a.diff |
|
38 | 39 | applying ../a.diff |
|
39 | 40 | Using custom patch |
|
40 | 41 | applied to working directory |
|
41 | 42 | |
|
42 | 43 | Issue2417: hg import with # comments in description |
|
43 | 44 | |
|
44 | 45 | Prepare source repo and patch: |
|
45 | 46 | |
|
46 | 47 | $ rm $HGRCPATH |
|
47 | 48 | $ hg init c |
|
48 | 49 | $ cd c |
|
49 | 50 | $ printf "a\rc" > a |
|
50 | 51 | $ hg ci -A -m 0 a -d '0 0' |
|
51 | 52 | $ printf "a\rb\rc" > a |
|
52 | 53 | $ cat << eof > log |
|
53 | 54 | > first line which can't start with '# ' |
|
54 | 55 | > # second line is a comment but that shouldn't be a problem. |
|
55 | 56 | > A patch marker like this was more problematic even after d7452292f9d3: |
|
56 | 57 | > # HG changeset patch |
|
57 | 58 | > # User lines looks like this - but it _is_ just a comment |
|
58 | 59 | > eof |
|
59 | 60 | $ hg ci -l log -d '0 0' |
|
60 | 61 | $ hg export -o p 1 |
|
61 | 62 | $ cd .. |
|
62 | 63 | |
|
63 | 64 | Clone and apply patch: |
|
64 | 65 | |
|
65 | 66 | $ hg clone -r 0 c d |
|
66 | 67 | adding changesets |
|
67 | 68 | adding manifests |
|
68 | 69 | adding file changes |
|
69 | 70 | added 1 changesets with 1 changes to 1 files |
|
70 | 71 | updating to branch default |
|
71 | 72 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
72 | 73 | $ cd d |
|
73 | 74 | $ hg import ../c/p |
|
74 | 75 | applying ../c/p |
|
75 | 76 | $ hg log -v -r 1 |
|
76 | 77 | changeset: 1:cd0bde79c428 |
|
77 | 78 | tag: tip |
|
78 | 79 | user: test |
|
79 | 80 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
80 | 81 | files: a |
|
81 | 82 | description: |
|
82 | 83 | first line which can't start with '# ' |
|
83 | 84 | # second line is a comment but that shouldn't be a problem. |
|
84 | 85 | A patch marker like this was more problematic even after d7452292f9d3: |
|
85 | 86 | # HG changeset patch |
|
86 | 87 | # User lines looks like this - but it _is_ just a comment |
|
87 | 88 | |
|
88 | 89 | |
|
89 | 90 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now