##// END OF EJS Templates
branching: merge stable into default
Raphaël Gomès -
r51748:b76a938c merge default
parent child Browse files
Show More
@@ -339,8 +339,9 b' def _dosign(ui, repo, *revs, **opts):'
339 repo.vfs.append(b"localsigs", sigmessage)
339 repo.vfs.append(b"localsigs", sigmessage)
340 return
340 return
341
341
342 msigs = match.exact([b'.hgsigs'])
343
342 if not opts[b"force"]:
344 if not opts[b"force"]:
343 msigs = match.exact([b'.hgsigs'])
344 if any(repo.status(match=msigs, unknown=True, ignored=True)):
345 if any(repo.status(match=msigs, unknown=True, ignored=True)):
345 raise error.Abort(
346 raise error.Abort(
346 _(b"working copy of .hgsigs is changed "),
347 _(b"working copy of .hgsigs is changed "),
@@ -11,7 +11,6 b''
11
11
12 from ..thirdparty import attr
12 from ..thirdparty import attr
13 from .. import (
13 from .. import (
14 encoding,
15 error,
14 error,
16 pycompat,
15 pycompat,
17 util,
16 util,
@@ -167,13 +166,7 b' def parserequestfromenv(env, reponame=No'
167 def tobytes(s):
166 def tobytes(s):
168 if not isinstance(s, str):
167 if not isinstance(s, str):
169 return s
168 return s
170 if pycompat.iswindows:
169 return s.encode('iso8859-1')
171 # This is what mercurial.encoding does for os.environ on
172 # Windows.
173 return encoding.strtolocal(s)
174 else:
175 # This is what is documented to be used for os.environ on Unix.
176 return pycompat.fsencode(s)
177
170
178 env = {tobytes(k): tobytes(v) for k, v in env.items()}
171 env = {tobytes(k): tobytes(v) for k, v in env.items()}
179
172
@@ -282,7 +282,7 b' pub fn matcher('
282 let (patterns, subwarnings) = parse_pattern_file_contents(
282 let (patterns, subwarnings) = parse_pattern_file_contents(
283 &config.includes,
283 &config.includes,
284 Path::new(""),
284 Path::new(""),
285 Some(b"relglob:".as_ref()),
285 Some(b"glob:".as_ref()),
286 false,
286 false,
287 )?;
287 )?;
288 warnings.extend(subwarnings.into_iter().map(From::from));
288 warnings.extend(subwarnings.into_iter().map(From::from));
@@ -292,7 +292,7 b' pub fn matcher('
292 let (patterns, subwarnings) = parse_pattern_file_contents(
292 let (patterns, subwarnings) = parse_pattern_file_contents(
293 &config.excludes,
293 &config.excludes,
294 Path::new(""),
294 Path::new(""),
295 Some(b"relglob:".as_ref()),
295 Some(b"glob:".as_ref()),
296 false,
296 false,
297 )?;
297 )?;
298 warnings.extend(subwarnings.into_iter().map(From::from));
298 warnings.extend(subwarnings.into_iter().map(From::from));
@@ -54,4 +54,21 b' and migrate secret keys'
54 e63c23eaa88a is signed by:
54 e63c23eaa88a is signed by:
55 hgtest
55 hgtest
56
56
57 The signature is different each time, so avoid signing the previous signature so
58 that the cset hashes are unchanging.
59 $ hg up -q '.^'
60
61 $ HGEDITOR=cat hg sign -f -e .
62 gpg: error retrieving key fingerprint from card: Invalid name (?)
63 signing 0:e63c23eaa88a
64 Added signature for changeset e63c23eaa88a
65
66
67 HG: Enter commit message. Lines beginning with 'HG:' are removed.
68 HG: Leave message empty to abort commit.
69 HG: --
70 HG: user: test
71 HG: branch 'default'
72 HG: added .hgsigs
73
57 $ cd ..
74 $ cd ..
@@ -21,6 +21,29 b' test sparse'
21 Verify basic --include
21 Verify basic --include
22
22
23 $ hg up -q 0
23 $ hg up -q 0
24
25 Test that sparse pattern by default is interpreted as "glob:", and is interpreted relative to the root.
26
27 $ hg debugsparse --reset
28 $ hg debugsparse -X 'foo*bar'
29 $ cat .hg/sparse
30 [exclude]
31 foo*bar
32
33 $ mk() { mkdir -p "$1"; touch "$1"/"$2"; }
34 $ mk 'foo' bar
35 $ mk 'foo-bar' x
36 $ mk 'unanchoredfoo-bar' x
37 $ mk 'foo*bar' x
38 $ mk 'dir/foo-bar' x
39 $ hg status --config rhg.on-unsupported=abort
40 ? dir/foo-bar/x
41 ? foo/bar
42 ? unanchoredfoo-bar/x
43 $ hg clean -a --no-confirm
44 $ rm -r foo*bar
45 $ hg debugsparse --reset
46
24 $ hg debugsparse --include 'hide'
47 $ hg debugsparse --include 'hide'
25 $ ls -A
48 $ ls -A
26 .hg
49 .hg
@@ -500,16 +500,9 b' class ParseRequestTests(unittest.TestCas'
500 self.assertEqual(r.reponame, b'repo')
500 self.assertEqual(r.reponame, b'repo')
501
501
502 def testenvencoding(self):
502 def testenvencoding(self):
503 if pycompat.iswindows:
503 b = b''.join(pycompat.bytechr(i) for i in range(256))
504 # On Windows, we can't generally know which non-ASCII characters
504 r = parse(DEFAULT_ENV, extra={'foo': b.decode('iso8859-1')})
505 # are supported.
505 self.assertEqual(r.rawenv[b'foo'], b)
506 r = parse(DEFAULT_ENV, extra={'foo': 'bar'})
507 self.assertEqual(r.rawenv[b'foo'], b'bar')
508 else:
509 # Unix is byte-based. Therefore we test all possible bytes.
510 b = b''.join(pycompat.bytechr(i) for i in range(256))
511 r = parse(DEFAULT_ENV, extra={'foo': pycompat.fsdecode(b)})
512 self.assertEqual(r.rawenv[b'foo'], b)
513
506
514
507
515 if __name__ == '__main__':
508 if __name__ == '__main__':
General Comments 0
You need to be logged in to leave comments. Login now