annotate tests/test-encoding.t @ 1095:60a82693d43c

tests: fix bad (re) match It seems fffe8883960b incorrectly did a match on the second parent (which is null) and that core Mercurial mistakenly matched the whole line with (re). This was recently fixed in 6d5718e39657 in core, so let's update the test with the correct match.
author Sean Farley <sean@farley.io>
date Thu, 30 Nov 2017 14:49:06 -0800
parents 93689e8f27ac
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
186
f4caf22b87cd Handle git repositories with legacy encodings.
Abderrahim Kitouni <a.kitouni@gmail.com>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
f4caf22b87cd Handle git repositories with legacy encodings.
Abderrahim Kitouni <a.kitouni@gmail.com>
parents:
diff changeset
2
575
a7da97e69d56 tests: extract extension configuration into a testutil library
David M. Carr <david@carrclan.us>
parents: 566
diff changeset
3 Load commonly used test logic
a7da97e69d56 tests: extract extension configuration into a testutil library
David M. Carr <david@carrclan.us>
parents: 566
diff changeset
4 $ . "$TESTDIR/testutil"
a7da97e69d56 tests: extract extension configuration into a testutil library
David M. Carr <david@carrclan.us>
parents: 566
diff changeset
5
578
935c4fb1bbfc tests: let git init create directories when applicable
David M. Carr <david@carrclan.us>
parents: 575
diff changeset
6 $ git init gitrepo
935c4fb1bbfc tests: let git init create directories when applicable
David M. Carr <david@carrclan.us>
parents: 575
diff changeset
7 Initialized empty Git repository in $TESTTMP/gitrepo/.git/
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
8 $ cd gitrepo
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
9
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
10 utf-8 encoded commit message
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
11 $ echo alpha > alpha
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
12 $ git add alpha
586
24d4741674a6 tests: use fn_git_commit in test-encoding.t
David M. Carr <david@carrclan.us>
parents: 585
diff changeset
13 $ fn_git_commit -m 'add älphà'
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
14
585
fbbdbc8a8785 tests: make test-encoding.t compatible with git 1.8.0
David M. Carr <david@carrclan.us>
parents: 580
diff changeset
15 Create some commits using latin1 encoding
fbbdbc8a8785 tests: make test-encoding.t compatible with git 1.8.0
David M. Carr <david@carrclan.us>
parents: 580
diff changeset
16 The warning message changed in Git 1.8.0
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
17 $ . $TESTDIR/latin-1-encoding
585
fbbdbc8a8785 tests: make test-encoding.t compatible with git 1.8.0
David M. Carr <david@carrclan.us>
parents: 580
diff changeset
18 Warning: commit message (did|does) not conform to UTF-8. (re)
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
19 You may want to amend it after fixing the message, or set the config
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
20 variable i18n.commitencoding to the encoding your project uses.
585
fbbdbc8a8785 tests: make test-encoding.t compatible with git 1.8.0
David M. Carr <david@carrclan.us>
parents: 580
diff changeset
21 Warning: commit message (did|does) not conform to UTF-8. (re)
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
22 You may want to amend it after fixing the message, or set the config
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
23 variable i18n.commitencoding to the encoding your project uses.
186
f4caf22b87cd Handle git repositories with legacy encodings.
Abderrahim Kitouni <a.kitouni@gmail.com>
parents:
diff changeset
24
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
25 $ cd ..
578
935c4fb1bbfc tests: let git init create directories when applicable
David M. Carr <david@carrclan.us>
parents: 575
diff changeset
26 $ git init --bare gitrepo2
528
e48a3f30b73c tests: remove piping of command git init to remove leading path
David M. Carr <david@carrclan.us>
parents: 527
diff changeset
27 Initialized empty Git repository in $TESTTMP/gitrepo2/
186
f4caf22b87cd Handle git repositories with legacy encodings.
Abderrahim Kitouni <a.kitouni@gmail.com>
parents:
diff changeset
28
529
7edcbdd2ef2f tests: eliminate use of git-daemon
David M. Carr <david@carrclan.us>
parents: 528
diff changeset
29 $ hg clone gitrepo hgrepo | grep -v '^updating'
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
30 importing git objects into hg
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
31 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
32 $ cd hgrepo
186
f4caf22b87cd Handle git repositories with legacy encodings.
Abderrahim Kitouni <a.kitouni@gmail.com>
parents:
diff changeset
33
870
93689e8f27ac tests: stop filtering out bookmark output
Siddharth Agarwal <sid0@fb.com>
parents: 844
diff changeset
34 $ HGENCODING=utf-8 hg log --graph --debug | grep -v 'phase:' | grep -v ': *author=' | grep -v ': *message='
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
35 @ changeset: 3:b8a0ac52f339ccd6d5729508bac4aee6e8b489d8
870
93689e8f27ac tests: stop filtering out bookmark output
Siddharth Agarwal <sid0@fb.com>
parents: 844
diff changeset
36 | bookmark: master
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
37 | tag: default/master
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
38 | tag: tip
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
39 | parent: 2:8bc4d64940260d4a1e70b54c099d3a76c83ff41e
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
40 | parent: -1:0000000000000000000000000000000000000000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
41 | manifest: 3:ea49f93388380ead5601c8fcbfa187516e7c2ed8
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
42 | user: tést èncödîng <test@example.org>
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
43 | date: Mon Jan 01 00:00:13 2007 +0000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
44 | files+: delta
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
45 | extra: branch=default
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
46 | extra: committer=test <test@example.org> 1167609613 0
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
47 | extra: encoding=latin-1
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
48 | extra: hg-git-rename-source=git
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
49 | description:
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
50 | add d\xc3\xa9lt\xc3\xa0 (esc)
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
51 |
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
52 |
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
53 o changeset: 2:8bc4d64940260d4a1e70b54c099d3a76c83ff41e
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
54 | parent: 1:f35a3100b78e57a0f5e4589a438f952a14b26ade
1095
60a82693d43c tests: fix bad (re) match
Sean Farley <sean@farley.io>
parents: 870
diff changeset
55 | parent: -1:0000000000000000000000000000000000000000
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
56 | manifest: 2:f580e7da3673c137370da2b931a1dee83590d7b4
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
57 | user: t\xc3\xa9st \xc3\xa8nc\xc3\xb6d\xc3\xaeng <test@example.org> (esc)
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
58 | date: Mon Jan 01 00:00:12 2007 +0000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
59 | files+: gamma
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
60 | extra: branch=default
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
61 | extra: committer=test <test@example.org> 1167609612 0
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
62 | extra: hg-git-rename-source=git
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
63 | description:
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
64 | add g\xc3\xa4mm\xc3\xa2 (esc)
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
65 |
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
66 |
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
67 o changeset: 1:f35a3100b78e57a0f5e4589a438f952a14b26ade
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
68 | parent: 0:87cd29b67a9159eec3b5495b0496ef717b2769f5
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
69 | parent: -1:0000000000000000000000000000000000000000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
70 | manifest: 1:f0bd6fbafbaebe4bb59c35108428f6fce152431d
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
71 | user: t\xc3\xa9st \xc3\xa8nc\xc3\xb6d\xc3\xaeng <test@example.org> (esc)
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
72 | date: Mon Jan 01 00:00:11 2007 +0000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
73 | files+: beta
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
74 | extra: branch=default
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
75 | extra: committer=test <test@example.org> 1167609611 0
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
76 | extra: hg-git-rename-source=git
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
77 | description:
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
78 | add beta
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
79 |
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
80 |
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
81 o changeset: 0:87cd29b67a9159eec3b5495b0496ef717b2769f5
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
82 parent: -1:0000000000000000000000000000000000000000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
83 parent: -1:0000000000000000000000000000000000000000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
84 manifest: 0:8b8a0e87dfd7a0706c0524afa8ba67e20544cbf0
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
85 user: test <test@example.org>
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
86 date: Mon Jan 01 00:00:10 2007 +0000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
87 files+: alpha
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
88 extra: branch=default
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
89 extra: hg-git-rename-source=git
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
90 description:
844
fffe8883960b git_handler: mark source for rename info as Git or Mercurial
Siddharth Agarwal <sid0@fb.com>
parents: 834
diff changeset
91 add \xc3\xa4lph\xc3\xa0 (esc)
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
92
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
93
202
1593538448b1 update tests to also push to git (not only clone)
Abderrahim Kitouni <a.kitouni@gmail.com>
parents: 186
diff changeset
94
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
95 $ hg gclear
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
96 clearing out the git cache data
529
7edcbdd2ef2f tests: eliminate use of git-daemon
David M. Carr <david@carrclan.us>
parents: 528
diff changeset
97 $ hg push ../gitrepo2
7edcbdd2ef2f tests: eliminate use of git-daemon
David M. Carr <david@carrclan.us>
parents: 528
diff changeset
98 pushing to ../gitrepo2
550
4bc39fd24db3 push: change "no changes" default output to match normal mercurial
David M. Carr <david@carrclan.us>
parents: 529
diff changeset
99 searching for changes
591
163c452531cf push: add more output about what was added (issue #64)
David M. Carr <david@carrclan.us>
parents: 586
diff changeset
100 adding objects
163c452531cf push: add more output about what was added (issue #64)
David M. Carr <david@carrclan.us>
parents: 586
diff changeset
101 added 4 commits with 4 trees and 4 blobs
186
f4caf22b87cd Handle git repositories with legacy encodings.
Abderrahim Kitouni <a.kitouni@gmail.com>
parents:
diff changeset
102
580
6cc99298b69e tests: avoid changing the current directory
David M. Carr <david@carrclan.us>
parents: 579
diff changeset
103 $ cd ..
6cc99298b69e tests: avoid changing the current directory
David M. Carr <david@carrclan.us>
parents: 579
diff changeset
104 $ git --git-dir=gitrepo2 log --pretty=medium
834
5a75bcc9da24 test-encoding: remove support for Git 1.7.x
Siddharth Agarwal <sid0@fb.com>
parents: 764
diff changeset
105 commit e85fef6b515d555e45124a5dc39a019cf8db9ff0
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
106 Author: t\xe9st \xe8nc\xf6d\xeeng <test@example.org> (esc)
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
107 Date: Mon Jan 1 00:00:13 2007 +0000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
108
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
109 add d\xe9lt\xe0 (esc)
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
110
834
5a75bcc9da24 test-encoding: remove support for Git 1.7.x
Siddharth Agarwal <sid0@fb.com>
parents: 764
diff changeset
111 commit bd576458238cbda49ffcfbafef5242e103f1bc24
585
fbbdbc8a8785 tests: make test-encoding.t compatible with git 1.8.0
David M. Carr <david@carrclan.us>
parents: 580
diff changeset
112 Author: * <test@example.org> (glob)
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
113 Date: Mon Jan 1 00:00:12 2007 +0000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
114
585
fbbdbc8a8785 tests: make test-encoding.t compatible with git 1.8.0
David M. Carr <david@carrclan.us>
parents: 580
diff changeset
115 add g*mm* (glob)
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
116
834
5a75bcc9da24 test-encoding: remove support for Git 1.7.x
Siddharth Agarwal <sid0@fb.com>
parents: 764
diff changeset
117 commit 7a7e86fc1b24db03109c9fe5da28b352de59ce90
585
fbbdbc8a8785 tests: make test-encoding.t compatible with git 1.8.0
David M. Carr <david@carrclan.us>
parents: 580
diff changeset
118 Author: * <test@example.org> (glob)
517
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
119 Date: Mon Jan 1 00:00:11 2007 +0000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
120
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
121 add beta
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
122
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
123 commit 0530b75d8c203e10dc934292a6a4032c6e958a83
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
124 Author: test <test@example.org>
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
125 Date: Mon Jan 1 00:00:10 2007 +0000
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
126
e1648c1c0e35 tests: unify test-encoding
David M. Carr <david@carrclan.us>
parents: 442
diff changeset
127 add älphà