Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
b3de1438028d
Commit
b3de1438028d
authored
14 years ago
by
Nicolas Dumazet
Browse files
Options
Downloads
Patches
Plain Diff
tests: unify test-tag
parent
7830e693b704
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test-tag.out
+0
-103
0 additions, 103 deletions
tests/test-tag.out
tests/test-tag.t
+182
-76
182 additions, 76 deletions
tests/test-tag.t
with
182 additions
and
179 deletions
tests/test-tag.out
deleted
100644 → 0
+
0
−
103
View file @
7830e693
changeset: 0:0acdaf898367
tag: tip
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: test
abort: tag names cannot consist entirely of whitespace
changeset: 1:3ecf002a1c57
tag: tip
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: Added tag bleah for changeset 0acdaf898367
changeset: 0:0acdaf898367
tag: bleah
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: test
abort: working copy of .hgtags is changed (please commit .hgtags manually)
failed
abort: tag names must be unique
failed
abort: the name 'tip' is reserved
failed
abort: tag 'bleah' already exists (use -f to force)
failed
abort: tag 'bleah' already exists (use -f to force)
failed
abort: tag 'blecch' does not exist
failed
abort: tag 'blecch' does not exist
failed
0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah
0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah0
868cc8fbb43b754ad09fa109885d243fc49adae7 gack
868cc8fbb43b754ad09fa109885d243fc49adae7 gawk
868cc8fbb43b754ad09fa109885d243fc49adae7 gorp
868cc8fbb43b754ad09fa109885d243fc49adae7 gack
3807bcf62c5614cb6c16436b514d7764ca5f1631 gack
3807bcf62c5614cb6c16436b514d7764ca5f1631 gack
0000000000000000000000000000000000000000 gack
868cc8fbb43b754ad09fa109885d243fc49adae7 gorp
0000000000000000000000000000000000000000 gorp
3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar
3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
abort: '\n' cannot be used in a tag name
abort: ':' cannot be used in a tag name
% cloning local tags
changeset: 0:0acdaf898367
tag: bleah
tag: bleah0
tag: foobar
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: test
changeset: 1:3ecf002a1c57
tag: bleah1
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: Added tag bleah for changeset 0acdaf898367
changeset: 2:868cc8fbb43b
tag: gawk
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: Added tag bleah0 for changeset 0acdaf898367
changeset: 3:3807bcf62c56
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: Added tag gack, gawk, gorp for changeset 868cc8fbb43b
changeset: 4:140c6e8597b4
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: Added tag gack for changeset 3807bcf62c56
changeset: 5:470a65fa7cc9
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: Removed tag gack, gorp
1[tip] 3ecf002a1c57 1970-01-12 13:46 +0000 test
Added tag bleah for changeset 0acdaf898367
5[tip] 470a65fa7cc9 1970-01-12 13:46 +0000 test
Removed tag gack, gorp
% issue 601
3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah13ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
f68b039e72eacbb2e68b0543e1f6e50990aa2bb5 localnewline
0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar
6ae703d793c8b1f097116869275ecd97b2977a2b newline
% tag and branch using same name
marked working directory as branch tag-and-branch-same-name
warning: tag tag-and-branch-same-name conflicts with existing branch name
% test custom commit messages
custom tag message
second line
This diff is collapsed.
Click to expand it.
tests/test-tag
→
tests/test-tag
.t
100755 → 100644
+
182
−
76
View file @
b3de1438
#!/bin/sh
$
hg
init
test
$
cd
test
...
...
@@ -2,4 +3,15 @@
hg init
test
cd test
$
echo
a
>
a
$
hg
add
a
$
hg
commit
-
m "test"
-
d
"
1000000 0
"
$
hg
history
changeset:
0
:
0
acdaf898367
tag:
tip
user:
test
date:
Mon
Jan
12
13
:
46
:
40
1970
+
0000
summary:
test
$
hg
tag
'
'
abort:
tag
names
cannot
consist
entirely
of
whitespace
...
...
@@ -5,6 +17,16 @@
echo
a
>
a
hg add a
hg commit
-m
"test"
-d
"1000000 0"
hg
history
$
hg
tag
-
d
"
1000000 0
"
"
bleah
"
$
hg
history
changeset:
1
:
3
ecf002a1c57
tag:
tip
user:
test
date:
Mon
Jan
12
13
:
46
:
40
1970
+
0000
summary:
Added
tag
bleah
for
changeset
0
acdaf898367
changeset:
0
:
0
acdaf898367
tag:
bleah
user:
test
date:
Mon
Jan
12
13
:
46
:
40
1970
+
0000
summary:
test
...
...
@@ -10,9 +32,6 @@
hg tag
' '
hg tag
-d
"1000000 0"
"bleah"
hg
history
echo
foo
>>
.hgtags
hg tag
-d
"1000000 0"
"bleah2"
||
echo
"failed"
$
echo
foo
>>
.
hgtags
$
hg
tag
-
d
"
1000000 0
"
"
bleah2
"
||
echo
"
failed
"
abort:
working
copy
of
.
hgtags
is
changed
(
please
commit
.
hgtags
manually
)
failed
...
...
@@ -18,7 +37,15 @@
hg revert .hgtags
hg tag
-d
"1000000 0"
-r
0 x y z y y z
||
echo
"failed"
hg tag
-d
"1000000 0"
tap nada dot tip null
.
||
echo
"failed"
hg tag
-d
"1000000 0"
"bleah"
||
echo
"failed"
hg tag
-d
"1000000 0"
"blecch"
"bleah"
||
echo
"failed"
$
hg
revert
.
hgtags
$
hg
tag
-
d
"
1000000 0
"
-
r
0
x
y
z
y y z || echo "failed"
abort: tag names must be unique
failed
$ hg tag -d "1000000 0" tap nada dot tip null . || echo "failed"
abort: the name 'tip' is reserved
failed
$ hg tag -d "1000000 0" "bleah" || echo "failed"
abort: tag 'bleah' already exists (use -f to force)
failed
$ hg tag -d "1000000 0" "blecch" "bleah" || echo "failed"
abort: tag 'bleah' already
exists
(
use
-
f
to
force
)
failed
...
...
@@ -24,4 +51,14 @@
hg tag
-d
"1000000 0"
--remove
"blecch"
||
echo
"failed"
hg tag
-d
"1000000 0"
--remove
"bleah"
"blecch"
"blough"
||
echo
"failed"
$
hg
tag
-
d
"
1000000 0
"
--
remove
"
blecch
"
||
echo
"
failed
"
abort:
tag
'
blecch
'
does
not
exist
failed
$
hg
tag
-
d
"
1000000 0
"
--
remove
"
bleah
"
"
blecch
"
"
blough
"
||
echo
"
failed
"
abort:
tag
'
blecch
'
does
not
exist
failed
$
hg
tag
-
d
"
1000000 0
"
-
r
0
"
bleah0
"
$
hg
tag
-
l
-
d
"
1000000 0
"
-
r
1
"
bleah1
"
$
hg
tag
-
d
"
1000000 0
"
gack
gawk
gorp
$
hg
tag
-
d
"
1000000 0
"
-
f
gack
$
hg
tag
-
d
"
1000000 0
"
--
remove
gack
gorp
...
...
@@ -27,7 +64,16 @@
hg tag
-d
"1000000 0"
-r
0
"bleah0"
hg tag
-l
-d
"1000000 0"
-r
1
"bleah1"
hg tag
-d
"1000000 0"
gack gawk gorp
hg tag
-d
"1000000 0"
-f
gack
hg tag
-d
"1000000 0"
--remove
gack gorp
$
cat
.
hgtags
0
acdaf8983679e0aac16e811534eb49d7ee1f2b4
bleah
0
acdaf8983679e0aac16e811534eb49d7ee1f2b4
bleah0
868
cc8fbb43b754ad09fa109885d243fc49adae7
gack
868
cc8fbb43b754ad09fa109885d243fc49adae7
gawk
868
cc8fbb43b754ad09fa109885d243fc49adae7
gorp
868
cc8fbb43b754ad09fa109885d243fc49adae7
gack
3807
bcf62c5614cb6c16436b514d7764ca5f1631
gack
3807
bcf62c5614cb6c16436b514d7764ca5f1631
gack
0000000000000000000000000000000000000000
gack
868
cc8fbb43b754ad09fa109885d243fc49adae7
gorp
0000000000000000000000000000000000000000
gorp
$
cat
.
hg
/
localtags
3
ecf002a1c572a2f3bb4e665417e60fca65bbd42
bleah1
...
...
@@ -33,4 +79,9 @@
cat
.hgtags
cat
.hg/localtags
$
hg
update
0
0
files
updated
,
0
files
merged
,
1
files
removed
,
0
files
unresolved
$
hg
tag
-
d
"
1000000 0
"
"
foobar
"
$
cat
.
hgtags
0
acdaf8983679e0aac16e811534eb49d7ee1f2b4
foobar
$
cat
.
hg
/
localtags
3
ecf002a1c572a2f3bb4e665417e60fca65bbd42
bleah1
...
...
@@ -36,6 +87,9 @@
hg update 0
hg tag
-d
"1000000 0"
"foobar"
cat
.hgtags
cat
.hg/localtags
$
hg
tag
-
l
'
xx
> newline
'
abort:
'
\n
'
cannot
be
used
in
a
tag
name
$
hg
tag
-
l
'
xx:xx
'
abort:
'
:
'
cannot
be
used
in
a
tag
name
cloning
local
tags
...
...
@@ -41,25 +95,51 @@
hg tag
-l
'xx
newline'
hg tag
-l
'xx:xx'
echo
% cloning
local
tags
cd
..
hg
-R
test
log
-r0
:5
hg clone
-q
-rbleah1
test
test1
hg
-R
test1 parents
--style
=
compact
hg clone
-q
-r5
test
#bleah1 test2
hg
-R
test2 parents
--style
=
compact
hg clone
-q
-U
test
#bleah1 test3
hg
-R
test3 parents
--style
=
compact
cd test
echo
% issue 601
python
<<
EOF
f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
f = file('.hg/localtags', 'w'); f.write(last); f.close()
EOF
cat
.hg/localtags
hg tag
-l
localnewline
cat
.hg/localtags
$
cd
..
$
hg
-
R
test
log
-
r0:5
changeset:
0
:
0
acdaf898367
tag:
bleah
tag:
bleah0
tag:
foobar
user:
test
date:
Mon
Jan
12
13
:
46
:
40
1970
+
0000
summary:
test
changeset:
1
:
3
ecf002a1c57
tag:
bleah1
user:
test
date:
Mon
Jan
12
13
:
46
:
40
1970
+
0000
summary:
Added
tag
bleah
for
changeset
0
acdaf898367
changeset:
2
:
868
cc8fbb43b
tag:
gawk
user:
test
date:
Mon
Jan
12
13
:
46
:
40
1970
+
0000
summary:
Added
tag
bleah0
for
changeset
0
acdaf898367
changeset:
3
:
3807
bcf62c56
user:
test
date:
Mon
Jan
12
13
:
46
:
40
1970
+
0000
summary:
Added
tag
gack
,
gawk
,
gorp
for
changeset
868
cc8fbb43b
changeset:
4
:
140
c6e8597b4
user:
test
date:
Mon
Jan
12
13
:
46
:
40
1970
+
0000
summary:
Added
tag
gack
for
changeset
3807
bcf62c56
changeset:
5
:
470
a65fa7cc9
user:
test
date:
Mon
Jan
12
13
:
46
:
40
1970
+
0000
summary:
Removed
tag
gack
,
gorp
$
hg
clone
-
q -rbleah1
test
test1
$
hg
-
R
test1
parents
--
style
=
compact
1
[
tip
]
3
ecf002a1c57
1970
-
01
-
12
13
:
46
+
0000
test
Added
tag
bleah
for
changeset
0
acdaf898367
$
hg
clone
-
q -r5
test
#bleah1 test2
$
hg
-
R
test2
parents
--
style
=
compact
5
[
tip
]
470
a65fa7cc9
1970
-
01
-
12
13
:
46
+
0000
test
Removed
tag
gack
,
gorp
$
hg
clone
-
q -U
test
#bleah1 test3
$
hg
-
R
test3
parents
--
style
=
compact
...
...
@@ -65,10 +145,17 @@
python
<<
EOF
f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
f = file('.hgtags', 'w'); f.write(last); f.close()
EOF
hg ci
-d
'1000000 0'
-m
'broken manual edit of .hgtags'
cat
.hgtags
hg tag
-d
'1000000 0'
newline
cat
.hgtags
$
cd
test
issue
601
$
python
<<
EOF
>
f
=
file
('
.hg/localtags
');
last
=
f
.
readlines
()[
-
1
][:
-
1
];
f
.
close
()
>
f
=
file
('
.hg/localtags
',
'
w
');
f
.
write
(
last
);
f
.
close
()
>
EOF
$
cat
.
hg
/
localtags
;
echo
3
ecf002a1c572a2f3bb4e665417e60fca65bbd42
bleah1
$
hg
tag
-
l
localnewline
$
cat
.
hg
/
localtags
;
echo
3
ecf002a1c572a2f3bb4e665417e60fca65bbd42
bleah1
f68b039e72eacbb2e68b0543e1f6e50990aa2bb5
localnewline
...
...
@@ -74,6 +161,16 @@
echo
% tag and branch using same name
hg branch tag-and-branch-same-name
hg ci
-m
"discouraged"
hg tag tag-and-branch-same-name
$
python
<<
EOF
>
f
=
file
('
.hgtags
');
last
=
f
.
readlines
()[
-
1
][:
-
1
];
f
.
close
()
>
f
=
file
('
.hgtags
',
'
w
');
f
.
write
(
last
);
f
.
close
()
>
EOF
$
hg
ci
-
d
'
1000000 0
'
-
m'broken manual edit of .hgtags'
$
cat
.
hgtags
;
echo
0
acdaf8983679e0aac16e811534eb49d7ee1f2b4
foobar
$
hg
tag
-
d
'
1000000 0
'
newline
$
cat
.
hgtags
;
echo
0
acdaf8983679e0aac16e811534eb49d7ee1f2b4
foobar
6
ae703d793c8b1f097116869275ecd97b2977a2b
newline
tag
and
branch
using
same
name
...
...
@@ -79,10 +176,19 @@
echo
'% test custom commit messages'
cat
>
$HGTMP
/editor
<<
'
__EOF__
'
#!/bin/sh
echo "custom tag message" > "
$1
"
echo "second line" >> "
$1
"
__EOF__
chmod
+x
"
$HGTMP
"
/editor
HGEDITOR
=
"'
$HGTMP
'"
/editor hg tag custom-tag
-e
hg log
-l1
--template
"{desc}
\n
"
$
hg
branch
tag
-
and
-
branch
-
same
-
name
marked
working
directory
as
branch
tag
-
and
-
branch
-
same
-
name
$
hg
ci
-
m"discouraged"
$
hg
tag
tag
-
and
-
branch
-
same
-
name
warning:
tag
tag
-
and
-
branch
-
same
-
name
conflicts
with
existing
branch
name
test
custom
commit
messages
$
cat
>
$HGTMP
/
editor
<<
'
__EOF__
'
>
#!/bin/sh
>
echo
"
custom tag message
"
>
"
$1
"
>
echo
"
second line
"
>>
"
$1
"
>
__EOF__
$
chmod
+
x
"
$HGTMP
"
/
editor
$
HGEDITOR
=
"
'
$HGTMP
'
"
/
editor
hg
tag
custom
-
tag
-
e
$
hg
log
-
l1
--
template
"
{desc}
\n
"
custom
tag
message
second
line
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment