Mercurial > hg
annotate tests/test-eol-hook.t @ 40326:fed697fa1734
sqlitestore: file storage backend using SQLite
This commit provides an extension which uses SQLite to store file
data (as opposed to revlogs).
As the inline documentation describes, there are still several
aspects to the extension that are incomplete. But it's a start.
The extension does support basic clone, checkout, and commit
workflows, which makes it suitable for simple use cases.
One notable missing feature is support for "bundlerepos." This is
probably responsible for the most test failures when the extension
is activated as part of the test suite.
All revision data is stored in SQLite. Data is stored as zstd
compressed chunks (default if zstd is available), zlib compressed
chunks (default if zstd is not available), or raw chunks (if
configured or if a compressed delta is not smaller than the raw
delta). This makes things very similar to revlogs.
Unlike revlogs, the extension doesn't yet enforce a limit on delta
chain length. This is an obvious limitation and should be addressed.
This is somewhat mitigated by the use of zstd, which is much faster
than zlib to decompress.
There is a dedicated table for storing deltas. Deltas are stored
by the SHA-1 hash of their uncompressed content. The "fileindex" table
has columns that reference the delta for each revision and the base
delta that delta should be applied against. A recursive SQL query
is used to resolve the delta chain along with the delta data.
By storing deltas by hash, we are able to de-duplicate delta storage!
With revlogs, the same deltas in different revlogs would result in
duplicate storage of that delta. In this scheme, inserting the
duplicate delta is a no-op and delta chains simply reference the
existing delta.
When initially implementing this extension, I did not have
content-indexed deltas and deltas could be duplicated across files
(just like revlogs). When I implemented content-indexed deltas, the
size of the SQLite database for a full clone of mozilla-unified
dropped:
before: 2,554,261,504 bytes
after: 2,488,754,176 bytes
Surprisingly, this is still larger than the bytes size of revlog
files:
revlog files: 2,104,861,230 bytes
du -b: 2,254,381,614
I would have expected storage to be smaller since we're not limiting
delta chain length and since we're using zstd instead of zlib. I
suspect the SQLite indexes and per-column overhead account for the
bulk of the differences. (Keep in mind that revlog uses a 64-byte
packed struct for revision index data and deltas are stored without
padding. Aside from the 12 unused bytes in the 32 byte node field,
revlogs are pretty efficient.) Another source of overhead is file
name storage. With revlogs, file names are stored in the filesystem.
But with SQLite, we need to store file names in the database. This is
roughly equivalent to the size of the fncache file, which for the
mozilla-unified repository is ~34MB.
Since the SQLite database isn't append-only and since delta chains
can reference any delta, this opens some interesting possibilities.
For example, we could store deltas in reverse, such that fulltexts
are stored for newer revisions and deltas are applied to reconstruct
older revisions. This is likely a more optimal storage strategy for
version control, as new data tends to be more frequently accessed
than old data. We would obviously need wire protocol support for
transferring revision data from newest to oldest. And we would
probably need some kind of mechanism for "re-encoding" stores. But
it should be doable.
This extension is very much experimental quality. There are a handful
of features that don't work. It probably isn't suitable for day-to-day
use. But it could be used in limited cases (e.g. read-only checkouts
like in CI). And it is also a good proving ground for alternate
storage backends. As we continue to define interfaces for all things
storage, it will be useful to have a viable alternate storage backend
to see how things shake out in practice.
test-storage.py passes on Python 2 and introduces no new test failures on
Python 3. Having the storage-level unit tests has proved to be insanely
useful when developing this extension. Those tests caught numerous bugs
during development and I'm convinced this style of testing is the way
forward for ensuring alternate storage backends work as intended. Of
course, test coverage isn't close to what it needs to be. But it is
a start. And what coverage we have gives me confidence that basic store
functionality is implemented properly.
Differential Revision: https://phab.mercurial-scm.org/D4928
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 09 Oct 2018 08:50:13 -0700 |
parents | f5b6b4e574c1 |
children | d7304434390f |
rev | line source |
---|---|
12423
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
1 Test the EOL hook |
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
2 |
12423
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
3 $ hg init main |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
4 $ cat > main/.hg/hgrc <<EOF |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
5 > [hooks] |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
6 > pretxnchangegroup = python:hgext.eol.hook |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
7 > EOF |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
8 $ hg clone main fork |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
9 updating to branch default |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
10 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
11 $ cd fork |
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
12 |
12423
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
13 Create repo |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
14 $ cat > .hgeol <<EOF |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
15 > [patterns] |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
16 > mixed.txt = BIN |
13501
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
17 > crlf.txt = CRLF |
12423
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
18 > **.txt = native |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
19 > EOF |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
20 $ hg add .hgeol |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
21 $ hg commit -m 'Commit .hgeol' |
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
22 |
12423
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
23 $ printf "first\nsecond\nthird\n" > a.txt |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
24 $ hg add a.txt |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
25 $ hg commit -m 'LF a.txt' |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
26 $ hg push ../main |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
27 pushing to ../main |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
28 searching for changes |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
29 adding changesets |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
30 adding manifests |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
31 adding file changes |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
32 added 2 changesets with 2 changes to 2 files |
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
33 |
12423
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
34 $ printf "first\r\nsecond\r\nthird\n" > a.txt |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
35 $ hg commit -m 'CRLF a.txt' |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
36 $ hg push ../main |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
37 pushing to ../main |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
38 searching for changes |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
39 adding changesets |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
40 adding manifests |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
41 adding file changes |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
42 added 1 changesets with 1 changes to 1 files |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
43 error: pretxnchangegroup hook failed: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
44 a.txt in a8ee6548cd86 should not have CRLF line endings |
12423
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
45 transaction abort! |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
46 rollback completed |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
47 abort: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
48 a.txt in a8ee6548cd86 should not have CRLF line endings |
12423
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
49 [255] |
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
50 |
12423
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
51 $ printf "first\nsecond\nthird\n" > a.txt |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
52 $ hg commit -m 'LF a.txt (fixed)' |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
53 $ hg push ../main |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
54 pushing to ../main |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
55 searching for changes |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
56 adding changesets |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
57 adding manifests |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
58 adding file changes |
10c3385fa89e
tests: unify test-eol-hook
Matt Mackall <mpm@selenic.com>
parents:
11249
diff
changeset
|
59 added 2 changesets with 2 changes to 1 files |
13501
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
60 |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
61 $ printf "first\nsecond\nthird\n" > crlf.txt |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
62 $ hg add crlf.txt |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
63 $ hg commit -m 'LF crlf.txt' |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
64 $ hg push ../main |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
65 pushing to ../main |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
66 searching for changes |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
67 adding changesets |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
68 adding manifests |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
69 adding file changes |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
70 added 1 changesets with 1 changes to 1 files |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
71 error: pretxnchangegroup hook failed: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
72 crlf.txt in 004ba2132725 should not have LF line endings |
13501
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
73 transaction abort! |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
74 rollback completed |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
75 abort: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
76 crlf.txt in 004ba2132725 should not have LF line endings |
13501
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
77 [255] |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
78 |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
79 $ printf "first\r\nsecond\r\nthird\r\n" > crlf.txt |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
80 $ hg commit -m 'CRLF crlf.txt (fixed)' |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
81 $ hg push ../main |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
82 pushing to ../main |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
83 searching for changes |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
84 adding changesets |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
85 adding manifests |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
86 adding file changes |
50b825c1adb1
eol: stop after first matched rule in hook (issue2660)
Antoine Pitrou <solipsis@pitrou.net>
parents:
12423
diff
changeset
|
87 added 2 changesets with 2 changes to 1 files |
13616
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
88 |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
89 $ printf "first\r\nsecond" > b.txt |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
90 $ hg add b.txt |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
91 $ hg commit -m 'CRLF b.txt' |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
92 $ hg push ../main |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
93 pushing to ../main |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
94 searching for changes |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
95 adding changesets |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
96 adding manifests |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
97 adding file changes |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
98 added 1 changesets with 1 changes to 1 files |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
99 error: pretxnchangegroup hook failed: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
100 b.txt in fbcf9b1025f5 should not have CRLF line endings |
13616
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
101 transaction abort! |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
102 rollback completed |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
103 abort: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
104 b.txt in fbcf9b1025f5 should not have CRLF line endings |
13616
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
105 [255] |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
106 |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
107 $ hg up -r -2 |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
108 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
109 $ printf "some\nother\nfile" > c.txt |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
110 $ hg add c.txt |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
111 $ hg commit -m "LF c.txt, b.txt doesn't exist here" |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
112 created new head |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
113 $ hg push -f ../main |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
114 pushing to ../main |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
115 searching for changes |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
116 adding changesets |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
117 adding manifests |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
118 adding file changes |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
119 added 2 changesets with 2 changes to 2 files (+1 heads) |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
120 error: pretxnchangegroup hook failed: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
121 b.txt in fbcf9b1025f5 should not have CRLF line endings |
13616
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
122 transaction abort! |
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
123 rollback completed |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
124 abort: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
125 b.txt in fbcf9b1025f5 should not have CRLF line endings |
13616
e6f93ca9ce86
eol: make the hook check all new heads, not only tip (issue2666)
Patrick Mezard <pmezard@gmail.com>
parents:
13615
diff
changeset
|
126 [255] |
13617
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
127 |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
128 Test checkheadshook alias |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
129 |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
130 $ cat > ../main/.hg/hgrc <<EOF |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
131 > [hooks] |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
132 > pretxnchangegroup = python:hgext.eol.checkheadshook |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
133 > EOF |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
134 $ hg push -f ../main |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
135 pushing to ../main |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
136 searching for changes |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
137 adding changesets |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
138 adding manifests |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
139 adding file changes |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
140 added 2 changesets with 2 changes to 2 files (+1 heads) |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
141 error: pretxnchangegroup hook failed: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
142 b.txt in fbcf9b1025f5 should not have CRLF line endings |
13617
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
143 transaction abort! |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
144 rollback completed |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
145 abort: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
146 b.txt in fbcf9b1025f5 should not have CRLF line endings |
13617
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
147 [255] |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
148 |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
149 We can fix the head and push again |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
150 |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
151 $ hg up 6 |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
152 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
153 $ printf "first\nsecond" > b.txt |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
154 $ hg ci -m "remove CRLF from b.txt" |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
155 $ hg push -f ../main |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
156 pushing to ../main |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
157 searching for changes |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
158 adding changesets |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
159 adding manifests |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
160 adding file changes |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
161 added 3 changesets with 3 changes to 2 files (+1 heads) |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
162 $ hg -R ../main rollback |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
163 repository tip rolled back to revision 5 (undo push) |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
164 |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
165 Test it still fails with checkallhook |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
166 |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
167 $ cat > ../main/.hg/hgrc <<EOF |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
168 > [hooks] |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
169 > pretxnchangegroup = python:hgext.eol.checkallhook |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
170 > EOF |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
171 $ hg push -f ../main |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
172 pushing to ../main |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
173 searching for changes |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
174 adding changesets |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
175 adding manifests |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
176 adding file changes |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
177 added 3 changesets with 3 changes to 2 files (+1 heads) |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
178 error: pretxnchangegroup hook failed: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
179 b.txt in fbcf9b1025f5 should not have CRLF line endings |
13617
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
180 transaction abort! |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
181 rollback completed |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
182 abort: end-of-line check failed: |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
183 b.txt in fbcf9b1025f5 should not have CRLF line endings |
13617
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
184 [255] |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
185 |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
186 But we can push the clean head |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
187 |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
188 $ hg push -r7 -f ../main |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
189 pushing to ../main |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
190 searching for changes |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
191 adding changesets |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
192 adding manifests |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
193 adding file changes |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
194 added 1 changesets with 1 changes to 1 files |
9cb1a42cd4b3
eol: rename hook into checkheadshook, add checkallhook (issue2665)
Patrick Mezard <pmezard@gmail.com>
parents:
13616
diff
changeset
|
195 |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
196 Test multiple files/revisions output |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
197 |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
198 $ printf "another\r\nbad\r\none" > d.txt |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
199 $ hg add d.txt |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
200 $ hg ci -m "add d.txt" |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
201 $ hg push -f ../main |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
202 pushing to ../main |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
203 searching for changes |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
204 adding changesets |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
205 adding manifests |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
206 adding file changes |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
207 added 3 changesets with 3 changes to 2 files (+1 heads) |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
208 error: pretxnchangegroup hook failed: end-of-line check failed: |
27524
f5b6b4e574c1
eol: make output stable
Bryan O'Sullivan <bos@serpentine.com>
parents:
16913
diff
changeset
|
209 b.txt in fbcf9b1025f5 should not have CRLF line endings |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
210 d.txt in a7040e68714f should not have CRLF line endings |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
211 transaction abort! |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
212 rollback completed |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
213 abort: end-of-line check failed: |
27524
f5b6b4e574c1
eol: make output stable
Bryan O'Sullivan <bos@serpentine.com>
parents:
16913
diff
changeset
|
214 b.txt in fbcf9b1025f5 should not have CRLF line endings |
13649
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
215 d.txt in a7040e68714f should not have CRLF line endings |
328ce8a405ac
eol: improve hook failure output
Patrick Mezard <pmezard@gmail.com>
parents:
13617
diff
changeset
|
216 [255] |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15131
diff
changeset
|
217 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15131
diff
changeset
|
218 $ cd .. |