Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hg-windows-ci
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
hg-windows-ci
Commits
72c086b1
Commit
72c086b1
authored
6 years ago
by
Yuya Nishihara
Browse files
Options
Downloads
Patches
Plain Diff
py3: byte-stringify literals in extension in test-bundle2-remote-changegroup.t
# skip-blame just some b''
parent
6437e89b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test-bundle2-remote-changegroup.t
+18
-18
18 additions, 18 deletions
tests/test-bundle2-remote-changegroup.t
with
18 additions
and
18 deletions
tests/test-bundle2-remote-changegroup.t
+
18
−
18
View file @
72c086b1
...
...
@@ -40,6 +40,6 @@
> Python expression as parameters. The Python expression is
> evaluated with eval, and is expected to be a dict.
>
"""
>
def
newpart
(
name
,
data
=
''):
>
def
newpart
(
name
,
data
=
b
''):
>
"""
wrapper around bundler.newpart adding an extra part making the
> client output information about each processed part
"""
...
...
@@ -44,6 +44,6 @@
>
"""
wrapper around bundler.newpart adding an extra part making the
> client output information about each processed part
"""
>
bundler
.
newpart
('
output
',
data
=
name
)
>
bundler
.
newpart
(
b
'
output
',
data
=
name
)
>
part
=
bundler
.
newpart
(
name
,
data
=
data
)
>
return
part
>
...
...
@@ -47,8 +47,8 @@
>
part
=
bundler
.
newpart
(
name
,
data
=
data
)
>
return
part
>
>
for
line
in
open
(
repo
.
vfs
.
join
('
bundle2maker
'),
'
rb
'):
>
for
line
in
open
(
repo
.
vfs
.
join
(
b
'
bundle2maker
'),
'
rb
'):
>
line
=
line
.
strip
()
>
try:
>
verb
,
args
=
line
.
split
(
None
,
1
)
>
except
ValueError:
...
...
@@ -51,8 +51,8 @@
>
line
=
line
.
strip
()
>
try:
>
verb
,
args
=
line
.
split
(
None
,
1
)
>
except
ValueError:
>
verb
,
args
=
line
,
''
>
if
verb
==
'
remote-changegroup
':
>
verb
,
args
=
line
,
b
''
>
if
verb
==
b
'
remote-changegroup
':
>
url
,
file
=
args
.
split
()
>
bundledata
=
open
(
file
,
'
rb
')
.
read
()
...
...
@@ -57,4 +57,4 @@
>
url
,
file
=
args
.
split
()
>
bundledata
=
open
(
file
,
'
rb
')
.
read
()
>
digest
=
util
.
digester
.
preferred
(
b2caps
['
digests
'])
>
digest
=
util
.
digester
.
preferred
(
b2caps
[
b
'
digests
'])
>
d
=
util
.
digester
([
digest
],
bundledata
)
...
...
@@ -60,10 +60,10 @@
>
d
=
util
.
digester
([
digest
],
bundledata
)
>
part
=
newpart
('
remote-changegroup
')
>
part
.
addparam
('
url
',
url
)
>
part
.
addparam
('
size
',
str
(
len
(
bundledata
)))
>
part
.
addparam
('
digests
',
digest
)
>
part
.
addparam
('
digest:%s
'
%
digest
,
d
[
digest
])
>
elif
verb
==
'
raw-remote-changegroup
':
>
part
=
newpart
('
remote-changegroup
')
>
part
=
newpart
(
b
'
remote-changegroup
')
>
part
.
addparam
(
b
'
url
',
url
)
>
part
.
addparam
(
b
'
size
',
str
(
len
(
bundledata
)))
>
part
.
addparam
(
b
'
digests
',
digest
)
>
part
.
addparam
(
b
'
digest:%s
'
%
digest
,
d
[
digest
])
>
elif
verb
==
b
'
raw-remote-changegroup
':
>
part
=
newpart
(
b
'
remote-changegroup
')
>
for
k
,
v
in
eval
(
args
)
.
items
():
>
part
.
addparam
(
k
,
str
(
v
))
...
...
@@ -68,7 +68,7 @@
>
for
k
,
v
in
eval
(
args
)
.
items
():
>
part
.
addparam
(
k
,
str
(
v
))
>
elif
verb
==
'
changegroup
':
>
elif
verb
==
b
'
changegroup
':
>
_common
,
heads
=
args
.
split
()
>
common
.
extend
(
repo
[
r
]
.
node
()
for
r
in
repo
.
revs
(
_common
))
>
heads
=
[
repo
[
r
]
.
node
()
for
r
in
repo
.
revs
(
heads
)]
>
outgoing
=
discovery
.
outgoing
(
repo
,
common
,
heads
)
...
...
@@ -71,10 +71,10 @@
>
_common
,
heads
=
args
.
split
()
>
common
.
extend
(
repo
[
r
]
.
node
()
for
r
in
repo
.
revs
(
_common
))
>
heads
=
[
repo
[
r
]
.
node
()
for
r
in
repo
.
revs
(
heads
)]
>
outgoing
=
discovery
.
outgoing
(
repo
,
common
,
heads
)
>
cg
=
changegroup
.
makechangegroup
(
repo
,
outgoing
,
'
01
',
>
'
changegroup
')
>
newpart
('
changegroup
',
cg
.
getchunks
())
>
cg
=
changegroup
.
makechangegroup
(
repo
,
outgoing
,
b
'
01
',
>
b
'
changegroup
')
>
newpart
(
b
'
changegroup
',
cg
.
getchunks
())
>
else
:
>
raise
Exception
('
unknown verb
')
>
...
...
@@ -78,7 +78,7 @@
>
else
:
>
raise
Exception
('
unknown verb
')
>
>
exchange
.
getbundle2partsmapping
['
changegroup
']
=
_getbundlechangegrouppart
>
exchange
.
getbundle2partsmapping
[
b
'
changegroup
']
=
_getbundlechangegrouppart
>
EOF
Start
a
simple
HTTP
server
to
serve
bundles
...
...
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