| 1 |
Testing cloning with the EOL extension |
| 2 |
|
| 3 |
$ cat >> $HGRCPATH <<EOF |
| 4 |
> [extensions] |
| 5 |
> eol = |
| 6 |
> |
| 7 |
> [eol] |
| 8 |
> native = CRLF |
| 9 |
> EOF |
| 10 |
|
| 11 |
setup repository |
| 12 |
|
| 13 |
$ hg init repo |
| 14 |
$ cd repo |
| 15 |
$ cat > .hgeol <<EOF |
| 16 |
> [patterns] |
| 17 |
> **.txt = native |
| 18 |
> EOF |
| 19 |
$ printf "first\r\nsecond\r\nthird\r\n" > a.txt |
| 20 |
$ hg commit --addremove -m 'checkin' |
| 21 |
adding .hgeol |
| 22 |
adding a.txt |
| 23 |
|
| 24 |
Test commit of removed .hgeol and how it immediately makes the automatic |
| 25 |
changes explicit and committable. |
| 26 |
|
| 27 |
$ cd .. |
| 28 |
$ hg clone repo repo-2 |
| 29 |
updating to branch default |
| 30 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 31 |
$ cd repo-2 |
| 32 |
$ cat a.txt |
| 33 |
first\r (esc) |
| 34 |
second\r (esc) |
| 35 |
third\r (esc) |
| 36 |
$ hg cat a.txt |
| 37 |
first |
| 38 |
second |
| 39 |
third |
| 40 |
$ hg remove .hgeol |
| 41 |
$ touch a.txt * # ensure consistent st dirtyness checks, ignoring dirstate timing |
| 42 |
$ hg st -v --debug |
| 43 |
M a.txt |
| 44 |
R .hgeol |
| 45 |
$ hg commit -m 'remove eol' |
| 46 |
$ hg exp |
| 47 |
# HG changeset patch |
| 48 |
# User test |
| 49 |
# Date 0 0 |
| 50 |
# Thu Jan 01 00:00:00 1970 +0000 |
| 51 |
# Node ID 3c20c2d90333b6ecdc8f7aa8f9b73223c7c7a608 |
| 52 |
# Parent 90f94e2cf4e24628afddd641688dfe4cd476d6e4 |
| 53 |
remove eol |
| 54 |
|
| 55 |
diff -r 90f94e2cf4e2 -r 3c20c2d90333 .hgeol |
| 56 |
--- a/.hgeol Thu Jan 01 00:00:00 1970 +0000 |
| 57 |
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 58 |
@@ -1,2 +0,0 @@ |
| 59 |
-[patterns] |
| 60 |
-**.txt = native |
| 61 |
diff -r 90f94e2cf4e2 -r 3c20c2d90333 a.txt |
| 62 |
--- a/a.txt Thu Jan 01 00:00:00 1970 +0000 |
| 63 |
+++ b/a.txt Thu Jan 01 00:00:00 1970 +0000 |
| 64 |
@@ -1,3 +1,3 @@ |
| 65 |
-first |
| 66 |
-second |
| 67 |
-third |
| 68 |
+first\r (esc) |
| 69 |
+second\r (esc) |
| 70 |
+third\r (esc) |
| 71 |
$ hg push --quiet |
| 72 |
$ cd .. |
| 73 |
|
| 74 |
Test clone of repo with .hgeol in working dir, but no .hgeol in default |
| 75 |
checkout revision tip. The repo is correctly updated to be consistent and have |
| 76 |
the exact content checked out without filtering, ignoring the current .hgeol in |
| 77 |
the source repo: |
| 78 |
|
| 79 |
$ cat repo/.hgeol |
| 80 |
[patterns] |
| 81 |
**.txt = native |
| 82 |
$ hg clone repo repo-3 -v --debug |
| 83 |
linked 8 files (no-rust !) |
| 84 |
linked 10 files (rust !) |
| 85 |
updating to branch default |
| 86 |
resolving manifests |
| 87 |
branchmerge: False, force: False, partial: False |
| 88 |
ancestor: 000000000000, local: 000000000000+, remote: 3c20c2d90333 |
| 89 |
calling hook preupdate.eol: hgext.eol.preupdate |
| 90 |
a.txt: remote created -> g |
| 91 |
getting a.txt |
| 92 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 93 |
updating the branch cache |
| 94 |
$ cd repo-3 |
| 95 |
|
| 96 |
$ cat a.txt |
| 97 |
first\r (esc) |
| 98 |
second\r (esc) |
| 99 |
third\r (esc) |
| 100 |
|
| 101 |
Test clone of revision with .hgeol |
| 102 |
|
| 103 |
$ cd .. |
| 104 |
$ hg clone -r 0 repo repo-4 |
| 105 |
adding changesets |
| 106 |
adding manifests |
| 107 |
adding file changes |
| 108 |
added 1 changesets with 2 changes to 2 files |
| 109 |
new changesets 90f94e2cf4e2 |
| 110 |
updating to branch default |
| 111 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 112 |
$ cd repo-4 |
| 113 |
$ cat .hgeol |
| 114 |
[patterns] |
| 115 |
**.txt = native |
| 116 |
|
| 117 |
$ cat a.txt |
| 118 |
first\r (esc) |
| 119 |
second\r (esc) |
| 120 |
third\r (esc) |
| 121 |
|
| 122 |
$ cd .. |