Show More
@@ -95,6 +95,8 b' utestpats = [' | |||||
95 | "explicit exit code checks unnecessary"), |
|
95 | "explicit exit code checks unnecessary"), | |
96 | (uprefix + r'set -e', "don't use set -e"), |
|
96 | (uprefix + r'set -e', "don't use set -e"), | |
97 | (uprefixc + r'( *)\t', "don't use tabs to indent"), |
|
97 | (uprefixc + r'( *)\t', "don't use tabs to indent"), | |
|
98 | (uprefixc + r'.*do\s*true;\s*done', | |||
|
99 | "don't use true as loop body, use sleep 0"), | |||
98 | ], |
|
100 | ], | |
99 | # warnings |
|
101 | # warnings | |
100 | [] |
|
102 | [] |
@@ -2438,9 +2438,9 b' def export(ui, repo, *changesets, **opts' | |||||
2438 | Returns 0 on success. |
|
2438 | Returns 0 on success. | |
2439 | """ |
|
2439 | """ | |
2440 | changesets += tuple(opts.get('rev', [])) |
|
2440 | changesets += tuple(opts.get('rev', [])) | |
2441 | if not changesets: |
|
2441 | revs = scmutil.revrange(repo, changesets) | |
|
2442 | if not revs: | |||
2442 | raise util.Abort(_("export requires at least one changeset")) |
|
2443 | raise util.Abort(_("export requires at least one changeset")) | |
2443 | revs = scmutil.revrange(repo, changesets) |
|
|||
2444 | if len(revs) > 1: |
|
2444 | if len(revs) > 1: | |
2445 | ui.note(_('exporting patches:\n')) |
|
2445 | ui.note(_('exporting patches:\n')) | |
2446 | else: |
|
2446 | else: |
@@ -127,7 +127,7 b' class changectx(object):' | |||||
127 | def phasestr(self): |
|
127 | def phasestr(self): | |
128 | return phases.phasenames[self.phase()] |
|
128 | return phases.phasenames[self.phase()] | |
129 | def mutable(self): |
|
129 | def mutable(self): | |
130 |
return self. |
|
130 | return self.phase() > phases.public | |
131 | def hidden(self): |
|
131 | def hidden(self): | |
132 | return self._rev in self._repo.changelog.hiddenrevs |
|
132 | return self._rev in self._repo.changelog.hiddenrevs | |
133 |
|
133 |
@@ -156,10 +156,10 b' def diffline(revs, a, b, opts):' | |||||
156 | return ' '.join(parts) + '\n' |
|
156 | return ' '.join(parts) + '\n' | |
157 |
|
157 | |||
158 | def unidiff(a, ad, b, bd, fn1, fn2, r=None, opts=defaultopts): |
|
158 | def unidiff(a, ad, b, bd, fn1, fn2, r=None, opts=defaultopts): | |
159 |
def datetag(date, |
|
159 | def datetag(date, fn=None): | |
160 | if not opts.git and not opts.nodates: |
|
160 | if not opts.git and not opts.nodates: | |
161 | return '\t%s\n' % date |
|
161 | return '\t%s\n' % date | |
162 |
if |
|
162 | if fn and ' ' in fn: | |
163 | return '\t\n' |
|
163 | return '\t\n' | |
164 | return '\n' |
|
164 | return '\n' | |
165 |
|
165 | |||
@@ -177,19 +177,19 b' def unidiff(a, ad, b, bd, fn1, fn2, r=No' | |||||
177 | elif not a: |
|
177 | elif not a: | |
178 | b = splitnewlines(b) |
|
178 | b = splitnewlines(b) | |
179 | if a is None: |
|
179 | if a is None: | |
180 |
l1 = '--- /dev/null%s' % datetag(epoch |
|
180 | l1 = '--- /dev/null%s' % datetag(epoch) | |
181 | else: |
|
181 | else: | |
182 | l1 = "--- %s%s" % ("a/" + fn1, datetag(ad)) |
|
182 | l1 = "--- %s%s" % ("a/" + fn1, datetag(ad, fn1)) | |
183 | l2 = "+++ %s%s" % ("b/" + fn2, datetag(bd)) |
|
183 | l2 = "+++ %s%s" % ("b/" + fn2, datetag(bd, fn2)) | |
184 | l3 = "@@ -0,0 +1,%d @@\n" % len(b) |
|
184 | l3 = "@@ -0,0 +1,%d @@\n" % len(b) | |
185 | l = [l1, l2, l3] + ["+" + e for e in b] |
|
185 | l = [l1, l2, l3] + ["+" + e for e in b] | |
186 | elif not b: |
|
186 | elif not b: | |
187 | a = splitnewlines(a) |
|
187 | a = splitnewlines(a) | |
188 | l1 = "--- %s%s" % ("a/" + fn1, datetag(ad)) |
|
188 | l1 = "--- %s%s" % ("a/" + fn1, datetag(ad, fn1)) | |
189 | if b is None: |
|
189 | if b is None: | |
190 |
l2 = '+++ /dev/null%s' % datetag(epoch |
|
190 | l2 = '+++ /dev/null%s' % datetag(epoch) | |
191 | else: |
|
191 | else: | |
192 | l2 = "+++ %s%s" % ("b/" + fn2, datetag(bd)) |
|
192 | l2 = "+++ %s%s" % ("b/" + fn2, datetag(bd, fn2)) | |
193 | l3 = "@@ -1,%d +0,0 @@\n" % len(a) |
|
193 | l3 = "@@ -1,%d +0,0 @@\n" % len(a) | |
194 | l = [l1, l2, l3] + ["-" + e for e in a] |
|
194 | l = [l1, l2, l3] + ["-" + e for e in a] | |
195 | else: |
|
195 | else: | |
@@ -199,8 +199,8 b' def unidiff(a, ad, b, bd, fn1, fn2, r=No' | |||||
199 | if not l: |
|
199 | if not l: | |
200 | return "" |
|
200 | return "" | |
201 |
|
201 | |||
202 | l.insert(0, "--- a/%s%s" % (fn1, datetag(ad))) |
|
202 | l.insert(0, "--- a/%s%s" % (fn1, datetag(ad, fn1))) | |
203 | l.insert(1, "+++ b/%s%s" % (fn2, datetag(bd))) |
|
203 | l.insert(1, "+++ b/%s%s" % (fn2, datetag(bd, fn2))) | |
204 |
|
204 | |||
205 | for ln in xrange(len(l)): |
|
205 | for ln in xrange(len(l)): | |
206 | if l[ln][-1] != '\n': |
|
206 | if l[ln][-1] != '\n': |
@@ -483,7 +483,7 b' class ui(object):' | |||||
483 | if not getattr(self.ferr, 'closed', False): |
|
483 | if not getattr(self.ferr, 'closed', False): | |
484 | self.ferr.flush() |
|
484 | self.ferr.flush() | |
485 | except IOError, inst: |
|
485 | except IOError, inst: | |
486 | if inst.errno not in (errno.EPIPE, errno.EIO): |
|
486 | if inst.errno not in (errno.EPIPE, errno.EIO, errno.EBADF): | |
487 | raise |
|
487 | raise | |
488 |
|
488 | |||
489 | def flush(self): |
|
489 | def flush(self): |
@@ -177,7 +177,6 b' def has_symlink():' | |||||
177 | return True |
|
177 | return True | |
178 | except (OSError, AttributeError): |
|
178 | except (OSError, AttributeError): | |
179 | return False |
|
179 | return False | |
180 | return hasattr(os, "symlink") # FIXME: should also check file system and os |
|
|||
181 |
|
180 | |||
182 | def has_tla(): |
|
181 | def has_tla(): | |
183 | return matchoutput('tla --version 2>&1', r'The GNU Arch Revision') |
|
182 | return matchoutput('tla --version 2>&1', r'The GNU Arch Revision') |
@@ -7,6 +7,7 b' plain' | |||||
7 | $ hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' \ |
|
7 | $ hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' \ | |
8 | > --config extensions.progress= --config progress.assume-tty=1 \ |
|
8 | > --config extensions.progress= --config progress.assume-tty=1 \ | |
9 | > --config progress.delay=0 --config progress.refresh=0 \ |
|
9 | > --config progress.delay=0 --config progress.refresh=0 \ | |
|
10 | > --config progress.format=topic,bar,number \ | |||
10 | > --config progress.width=60 2>&1 | \ |
|
11 | > --config progress.width=60 2>&1 | \ | |
11 | > python "$TESTDIR/filtercr.py" |
|
12 | > python "$TESTDIR/filtercr.py" | |
12 |
|
13 |
@@ -140,3 +140,54 b' 0 lines of context hunk header matches g' | |||||
140 | +c3 |
|
140 | +c3 | |
141 | @@ -3,1 +4,0 @@ c4 |
|
141 | @@ -3,1 +4,0 @@ c4 | |
142 | -c5 |
|
142 | -c5 | |
|
143 | ||||
|
144 | $ echo a > f1 | |||
|
145 | $ hg ci -m movef2 | |||
|
146 | ||||
|
147 | Test diff headers terminating with TAB when necessary (issue3357) | |||
|
148 | Regular diff --nodates, file creation | |||
|
149 | ||||
|
150 | $ hg mv f1 'f 1' | |||
|
151 | $ echo b > 'f 1' | |||
|
152 | $ hg diff --nodates 'f 1' | |||
|
153 | diff -r 7574207d0d15 f 1 | |||
|
154 | --- /dev/null | |||
|
155 | +++ b/f 1 | |||
|
156 | @@ -0,0 +1,1 @@ | |||
|
157 | +b | |||
|
158 | ||||
|
159 | Git diff, adding space | |||
|
160 | ||||
|
161 | $ hg diff --git | |||
|
162 | diff --git a/f1 b/f 1 | |||
|
163 | rename from f1 | |||
|
164 | rename to f 1 | |||
|
165 | --- a/f1 | |||
|
166 | +++ b/f 1 | |||
|
167 | @@ -1,1 +1,1 @@ | |||
|
168 | -a | |||
|
169 | +b | |||
|
170 | ||||
|
171 | Regular diff --nodates, file deletion | |||
|
172 | ||||
|
173 | $ hg ci -m addspace | |||
|
174 | $ hg mv 'f 1' f1 | |||
|
175 | $ echo a > f1 | |||
|
176 | $ hg diff --nodates 'f 1' | |||
|
177 | diff -r ca50fe67c9c7 f 1 | |||
|
178 | --- a/f 1 | |||
|
179 | +++ /dev/null | |||
|
180 | @@ -1,1 +0,0 @@ | |||
|
181 | -b | |||
|
182 | ||||
|
183 | Git diff, removing space | |||
|
184 | ||||
|
185 | $ hg diff --git | |||
|
186 | diff --git a/f 1 b/f1 | |||
|
187 | rename from f 1 | |||
|
188 | rename to f1 | |||
|
189 | --- a/f 1 | |||
|
190 | +++ b/f1 | |||
|
191 | @@ -1,1 +1,1 @@ | |||
|
192 | -b | |||
|
193 | +a |
@@ -129,3 +129,17 b' Checking if only alphanumeric characters' | |||||
129 | exporting patch: |
|
129 | exporting patch: | |
130 | ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch |
|
130 | ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch | |
131 |
|
131 | |||
|
132 | Catch exporting unknown revisions (especially empty revsets, see issue3353) | |||
|
133 | ||||
|
134 | $ hg export | |||
|
135 | abort: export requires at least one changeset | |||
|
136 | [255] | |||
|
137 | $ hg export "" | |||
|
138 | hg: parse error: empty query | |||
|
139 | [255] | |||
|
140 | $ hg export 999 | |||
|
141 | abort: unknown revision '999'! | |||
|
142 | [255] | |||
|
143 | $ hg export "not all()" | |||
|
144 | abort: export requires at least one changeset | |||
|
145 | [255] |
@@ -11,7 +11,7 b' Do test while holding fifo open' | |||||
11 | $ ( |
|
11 | $ ( | |
12 | > echo lock |
|
12 | > echo lock | |
13 | > echo addchangegroup |
|
13 | > echo addchangegroup | |
14 |
> while [ ! -s .hg/store/journal ]; do |
|
14 | > while [ ! -s .hg/store/journal ]; do sleep 0; done | |
15 | > kill -HUP $P |
|
15 | > kill -HUP $P | |
16 | > ) > p |
|
16 | > ) > p | |
17 |
|
17 |
@@ -28,6 +28,14 b' qimport non-existing-file' | |||||
28 | abort: unable to read file non-existing-file |
|
28 | abort: unable to read file non-existing-file | |
29 | [255] |
|
29 | [255] | |
30 |
|
30 | |||
|
31 | qimport null revision | |||
|
32 | ||||
|
33 | $ hg qimport -r null | |||
|
34 | abort: revision -1 is not mutable | |||
|
35 | (see "hg help phases" for details) | |||
|
36 | [255] | |||
|
37 | $ hg qseries | |||
|
38 | ||||
31 | import email |
|
39 | import email | |
32 |
|
40 | |||
33 | $ hg qimport --push -n email - <<EOF |
|
41 | $ hg qimport --push -n email - <<EOF |
General Comments 0
You need to be logged in to leave comments.
Login now