comparison tests/test-export.t @ 14986:70e11de6964d

export: add %m to file format string (first line of the commit message) $ hg commit -m "Initial commit" $ hg export -o %m.patch tip #It creates Initial_commit.patch file.
author Andrzej Bieniek <andyhelp@gmail.com>
date Sat, 30 Jul 2011 11:08:45 +0100
parents a5b77eb0409b
children 8ca7187d479f
comparison
equal deleted inserted replaced
14985:dbf91976f900 14986:70e11de6964d
5 $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do 5 $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
6 > echo "foo-$i" >> foo 6 > echo "foo-$i" >> foo
7 > hg ci -m "foo-$i" 7 > hg ci -m "foo-$i"
8 > done 8 > done
9 9
10 $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r"; do 10 $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r" "%m"; do
11 > echo 11 > echo
12 > echo "# foo-$out.patch" 12 > echo "# foo-$out.patch"
13 > hg export -v -o "foo-$out.patch" 2:tip 13 > hg export -v -o "foo-$out.patch" 2:tip
14 > done 14 > done
15 15
75 foo-07.patch 75 foo-07.patch
76 foo-08.patch 76 foo-08.patch
77 foo-09.patch 77 foo-09.patch
78 foo-10.patch 78 foo-10.patch
79 foo-11.patch 79 foo-11.patch
80
81 # foo-%m.patch
82 exporting patches:
83 foo-foo_2.patch
84 foo-foo_3.patch
85 foo-foo_4.patch
86 foo-foo_5.patch
87 foo-foo_6.patch
88 foo-foo_7.patch
89 foo-foo_8.patch
90 foo-foo_9.patch
91 foo-foo_10.patch
92 foo-foo_11.patch
80 93
81 Exporting 4 changesets to a file: 94 Exporting 4 changesets to a file:
82 95
83 $ hg export -o export_internal 1 2 3 4 96 $ hg export -o export_internal 1 2 3 4
84 $ grep HG export_internal | wc -l 97 $ grep HG export_internal | wc -l
106 foo-7 119 foo-7
107 foo-8 120 foo-8
108 foo-9 121 foo-9
109 +foo-10 122 +foo-10
110 123
124 Checking if only alphanumeric characters are used in the file name (%m option):
125
126 $ echo "line" >> foo
127 $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~"
128 $ hg export -v -o %m.patch tip
129 exporting patch:
130 ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch
131