author | Patrick Mezard <pmezard@gmail.com> |
Fri, 01 Jan 2010 20:52:05 +0100 | |
changeset 10188 | fd6e9c7cd98c |
parent 10186 | 296a0b14a686 |
child 10190 | 9c2c94934f0d |
permissions | -rwxr-xr-x |
8426 | 1 |
#!/bin/sh |
2 |
||
3 |
echo "[extensions]" >> $HGRCPATH |
|
4 |
echo "mq=" >> $HGRCPATH |
|
5 |
||
6 |
filterdiff() |
|
7 |
{ |
|
8 |
grep -v diff | \ |
|
9 |
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
10 |
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" |
|
11 |
} |
|
12 |
||
13 |
echo '% init' |
|
14 |
hg init repo |
|
15 |
cd repo |
|
16 |
echo a > a |
|
17 |
hg ci -Am adda |
|
18 |
echo a >> a |
|
19 |
hg qnew -f p1 |
|
20 |
echo b >> a |
|
21 |
hg qnew -f p2 |
|
22 |
echo c >> a |
|
23 |
hg qnew -f p3 |
|
24 |
echo '% fold in the middle of the queue' |
|
25 |
hg qpop p1 |
|
26 |
hg qdiff | filterdiff |
|
27 |
hg qfold p2 |
|
10186
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
28 |
grep git .hg/patches/p1 && echo 'git patch found!' |
8426 | 29 |
hg qser |
30 |
hg qdiff | filterdiff |
|
31 |
echo '% fold with local changes' |
|
32 |
echo d >> a |
|
33 |
hg qfold p3 |
|
34 |
hg diff -c . | filterdiff |
|
10186
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
35 |
hg revert -a --no-backup |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
36 |
|
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
37 |
echo '% fold git patch into a regular patch, expect git patch' |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
38 |
echo a >> a |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
39 |
hg qnew -f regular |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
40 |
hg cp a aa |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
41 |
hg qnew --git -f git |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
42 |
hg qpop |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
43 |
hg qfold git |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
44 |
cat .hg/patches/regular |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
45 |
hg qpop |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
46 |
hg qdel regular |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
47 |
|
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
48 |
echo '% fold regular patch into a git patch, expect git patch' |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
49 |
hg cp a aa |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
50 |
hg qnew --git -f git |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
51 |
echo b >> aa |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
52 |
hg qnew -f regular |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
53 |
hg qpop |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
54 |
hg qfold regular |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
55 |
cat .hg/patches/git |
296a0b14a686
mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents:
8426
diff
changeset
|
56 |
|
8426 | 57 |
cd .. |
58 |
||
59 |