Show More
@@ -0,0 +1,14 b'' | |||
|
1 | #!/usr/bin/env python3 | |
|
2 | # | |
|
3 | # A tool to help producing large and poorly compressible files | |
|
4 | # | |
|
5 | # Usage: | |
|
6 | # $TESTDIR/seq.py 1000 | $TESTDIR/sha256line.py > my-file.txt | |
|
7 | ||
|
8 | ||
|
9 | import hashlib | |
|
10 | import sys | |
|
11 | ||
|
12 | ||
|
13 | for line in sys.stdin: | |
|
14 | print(hashlib.sha256(line.encode('utf8')).hexdigest()) |
@@ -255,3 +255,4 b' 27055614b68538576fb0439007009acf93fe0a49' | |||
|
255 | 255 | 26c57e7a0890b96e2c473b394de380d6753c9230 0 iQHNBAABCgA3FiEEH2b4zfZU6QXBHaBhoR4BzQ4F2VYFAmVcykAZHGFscGhhcmVAcmFwaGFlbGdvbWVzLmRldgAKCRChHgHNDgXZVoGeC/0Uvynfd4xJMSa3ef4lOrw3l0PsOMzLwcITC5b4SlMfo8sHDq1Vr169z/IvI/FhJ8LmK/Spg7OK6TkqJ33fOmpnKZji8oCstM8q0P6xZh55RIE4St8Px/TuC99HvB41sPgcBDQf/dfvXqUKHImxH5C21p93AkvdCie9sdeYzy23VSn1URBBRkfToB6U7QDvktiKE4Hy/mJolNd0FlTOrRiD7K4bzstaLZP8kO1gJQPCPBjqN8glXN/arebcdu8zD7sE22JZA87pJljY7Wy3P6O1zRol2qDPCBshK2zDbrljyOaKR10ciHUBJV0V11nK6xIZ4XE2N4xes3fYlBNsudHXvLutCv40e1VDVjRe2X6ayRZCnKkYI0s4oTl9oFo5olrsfeC5+b/exqB8oTCCqmMFdz3/QFO7/pQ3xck2XaWucG+o3R/y91t6Uy+5LPtIOsR5IevvPIiebpQgIMJkOIRrz5j59U+MafTSGfaDel/niPISQPWZ9T0ORS6q9uNRHCo= |
|
256 | 256 | 71bd09bebbe36a09569cbfb388f371433360056b 0 iQHNBAABCgA3FiEEH2b4zfZU6QXBHaBhoR4BzQ4F2VYFAmVxxyYZHGFscGhhcmVAcmFwaGFlb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SF4llyt80IB89WrfdwTZqNUfZcwPgFG8ajW5v/jHvic5DZSxvDfmCvNIxhtOoz8BVZMXi3DzDOMbT20D9leCcBwmHoFYNAZC/z4QwkrXFgrbFiy27Sj5LqFqO1hlY3NVpk01F2w= |
|
258 | 3fd1efb3ad124e6686c0fb66e6943cd8aeea5681 0 iQHNBAABCgA3FiEEH2b4zfZU6QXBHaBhoR4BzQ4F2VYFAmXKNjoZHGFscGhhcmVAcmFwaGFlbGdvbWVzLmRldgAKCRChHgHNDgXZVhW9DACokMQuCQ6QzyrgXmAFwcg0czClQ7lJBfV+IHKk1oRmVWUj1jifKI2S3+BU1RgBO7FiG9r6NFOdCiL78VJN0W3YlBPW+Mp8joBkXGOyFiob4MI0w7Up04LLdVtvms2eEuAH7XVcRgbgWOcU6aTwcenYXMVkenhGShbKJBZU7ogAbu/y156bTmhuj3SVxUvmgtvXEACwHnPgdEdIPlssf7dDm6XHWhAU+60I2L5ECl7dEYZe2b5NwEvaHdWVjY+BEeVzrPvAjTaOP18HBtzawhf4PAEpBOwy5hX+k/EVaMMWLzCeF56vWfZXl+2AXDNQ3KIfmgZbRfJSGBA/VAxVob6bt/qRwj0vDIy52wgceITyZVnpynp9MS0sQ5rslyzNoPA6v4nWSPYXyorp22TY6hL5TyyF9cyyXoyNgtwvIzjFUqNnLQK1Qxqo1Pq0Au5nT2eJVWzUTD9znsYNuMKunlSyQwM9shjP78tLmVE/5IplcXq1cEXBwjyk30u6cBziPS8= |
@@ -271,3 +271,4 b' 27055614b68538576fb0439007009acf93fe0a49' | |||
|
271 | 271 | 26c57e7a0890b96e2c473b394de380d6753c9230 6.6 |
|
272 | 272 | 71bd09bebbe36a09569cbfb388f371433360056b 6.6.1 |
|
273 | 273 | 136902b3a95db38854ebaf5198a627641065c2ea 6.6.2 |
|
274 | 3fd1efb3ad124e6686c0fb66e6943cd8aeea5681 6.6.3 |
@@ -3680,7 +3680,7 b' def grep(ui, repo, pattern, *pats, **opt' | |||
|
3680 | 3680 | |
|
3681 | 3681 | wopts = logcmdutil.walkopts( |
|
3682 | 3682 | pats=pats, |
|
3683 | opts=opts, | |
|
3683 | opts=pycompat.byteskwargs(opts), | |
|
3684 | 3684 | revspec=opts['rev'], |
|
3685 | 3685 | include_pats=opts['include'], |
|
3686 | 3686 | exclude_pats=opts['exclude'], |
@@ -1,3 +1,12 b'' | |||
|
1 | = Mercurial 6.6.3 = | |
|
2 | ||
|
3 | * tests: don't use "status" operand of dd in test-censor.t (issue6858) | |
|
4 | * tests: make sha256line.py available for all tests | |
|
5 | * tests: use sha256line.py instead of /dev/random in test-censor.t (issue6858) | |
|
6 | * tests: fix nondeterministic test failure in test-contrib-perf.t | |
|
7 | * rust-changelog: don't panic on empty file lists | |
|
8 | * grep: restore usage of --include/--exclude options | |
|
9 | ||
|
1 | 10 |
|
|
2 | 11 | |
|
3 | 12 | * histedit: remove superfluous echo() and endwin() calls (issue6859) |
@@ -5,10 +5,11 b' use crate::revlog::{Revlog, RevlogEntry,' | |||
|
5 | 5 | use crate::utils::hg_path::HgPath; |
|
6 | 6 | use crate::vfs::Vfs; |
|
7 | 7 | use crate::{Graph, GraphError, RevlogOpenOptions, UncheckedRevision}; |
|
8 | use itertools::Itertools; | |
|
8 | use itertools::{Either, Itertools}; | |
|
9 | 9 | use std::ascii::escape_default; |
|
10 | 10 | use std::borrow::Cow; |
|
11 | 11 | use std::fmt::{Debug, Formatter}; |
|
12 | use std::iter; | |
|
12 | 13 | |
|
13 | 14 | /// A specialized `Revlog` to work with changelog data format. |
|
14 | 15 | pub struct Changelog { |
@@ -230,9 +231,15 b" impl<'changelog> ChangelogRevisionData<'" | |||
|
230 | 231 | |
|
231 | 232 | /// The files changed in this revision. |
|
232 | 233 | pub fn files(&self) -> impl Iterator<Item = &HgPath> { |
|
234 | if self.timestamp_end == self.files_end { | |
|
235 | Either::Left(iter::empty()) | |
|
236 | } else { | |
|
237 | Either::Right( | |
|
233 | 238 | self.bytes[self.timestamp_end + 1..self.files_end] |
|
234 | 239 | .split(|b| b == &b'\n') |
|
235 | .map(HgPath::new) | |
|
240 | .map(HgPath::new), | |
|
241 | ) | |
|
242 | } | |
|
236 | 243 | } |
|
237 | 244 | |
|
238 | 245 | /// The change description. |
@@ -360,4 +367,12 b' message",' | |||
|
360 | 367 | ); |
|
361 | 368 | Ok(()) |
|
362 | 369 | } |
|
370 | ||
|
371 | #[test] | |
|
372 | fn test_empty_files_list() { | |
|
373 | assert!(ChangelogRevisionData::null() | |
|
374 | .files() | |
|
375 | .collect_vec() | |
|
376 | .is_empty()); | |
|
363 | 377 | } |
|
378 | } |
@@ -316,7 +316,7 b' Can censor enough revision to move back ' | |||
|
316 | 316 | rev-count data-size inl type target |
|
317 | 317 | 8 ??? no file target (glob) (revlogv2 !) |
|
318 | 318 | 8 ??? yes file target (glob) (revlogv1 !) |
|
319 | $ cat /dev/rand?m | dd status=none count=200 | f --hexdump > target | |
|
319 | $ $TESTDIR/seq.py 4000 | $TESTDIR/sha256line.py > target | |
|
320 | 320 | $ hg ci -m 'add 100k passwords' |
|
321 | 321 | $ H2=`hg id --debug -i` |
|
322 | 322 | $ C5=$H2 |
@@ -525,6 +525,23 b' Test wdir' | |||
|
525 | 525 | port2:2147483647:deport |
|
526 | 526 | port2:2147483647:wport |
|
527 | 527 | |
|
528 | Testing include/exclude | |
|
529 | ||
|
530 | $ hg cp port tort | |
|
531 | $ hg grep port -X tort | |
|
532 | port:export | |
|
533 | port:vaportight | |
|
534 | port:import/export | |
|
535 | port2:export | |
|
536 | port2:vaportight | |
|
537 | port2:import/export | |
|
538 | port2:deport | |
|
539 | port2:wport | |
|
540 | $ hg grep port -I tort | |
|
541 | tort:export | |
|
542 | tort:vaportight | |
|
543 | tort:import/export | |
|
544 | ||
|
528 | 545 | $ cd .. |
|
529 | 546 | $ hg init t2 |
|
530 | 547 | $ cd t2 |
@@ -10,20 +10,13 b' basic setup' | |||
|
10 | 10 | > [debug] |
|
11 | 11 | > revlog.debug-delta=yes |
|
12 | 12 | > EOF |
|
13 | $ cat << EOF >> sha256line.py | |
|
14 | > # a way to quickly produce file of significant size and poorly compressable content. | |
|
15 | > import hashlib | |
|
16 | > import sys | |
|
17 | > for line in sys.stdin: | |
|
18 | > print(hashlib.sha256(line.encode('utf8')).hexdigest()) | |
|
19 | > EOF | |
|
20 | 13 | |
|
21 | 14 | $ hg init base-repo |
|
22 | 15 | $ cd base-repo |
|
23 | 16 | |
|
24 | 17 | create a "large" file |
|
25 | 18 | |
|
26 |
$ $TESTDIR/seq.py 1000 | $ |
|
|
19 | $ $TESTDIR/seq.py 1000 | $TESTDIR/sha256line.py > my-file.txt | |
|
27 | 20 | $ hg add my-file.txt |
|
28 | 21 | $ hg commit -m initial-commit |
|
29 | 22 | DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob) |
@@ -32,7 +25,7 b' create a "large" file' | |||
|
32 | 25 | |
|
33 | 26 | Add more change at the end of the file |
|
34 | 27 | |
|
35 |
$ $TESTDIR/seq.py 1001 1200 | $ |
|
|
28 | $ $TESTDIR/seq.py 1001 1200 | $TESTDIR/sha256line.py >> my-file.txt | |
|
36 | 29 | $ hg commit -m "large-change" |
|
37 | 30 | DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob) |
|
38 | 31 | DBG-DELTAS: MANIFESTLOG: * (glob) |
@@ -273,7 +266,7 b' We build a very different file content t' | |||
|
273 | 266 | |
|
274 | 267 | $ hg -R peer-bad-delta-with-full update 'desc("merge")' --quiet |
|
275 | 268 | $ ($TESTDIR/seq.py 2000 2100; $TESTDIR/seq.py 500 510; $TESTDIR/seq.py 3000 3050) \ |
|
276 |
> | $ |
|
|
269 | > | $TESTDIR/sha256line.py > peer-bad-delta-with-full/my-file.txt | |
|
277 | 270 | $ hg -R peer-bad-delta-with-full commit -m 'trigger-full' |
|
278 | 271 | DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob) |
|
279 | 272 | DBG-DELTAS: MANIFESTLOG: * (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now