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
fb6226c15e54
Commit
fb6226c15e54
authored
6 years ago
by
Augie Fackler
Browse files
Options
Downloads
Patches
Plain Diff
lfs: stabilize error message values for Python 2 and 3
Differential Revision:
https://phab.mercurial-scm.org/D3513
parent
b8c2004a8d2b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hgext/lfs/pointer.py
+10
-3
10 additions, 3 deletions
hgext/lfs/pointer.py
with
10 additions
and
3 deletions
hgext/lfs/pointer.py
+
10
−
3
View file @
fb6226c1
...
...
@@ -15,6 +15,9 @@
error
,
pycompat
,
)
from
mercurial.utils
import
(
stringutil
,
)
class
InvalidPointer
(
error
.
RevlogError
):
pass
...
...
@@ -32,7 +35,9 @@
try
:
return
cls
(
l
.
split
(
'
'
,
1
)
for
l
in
text
.
splitlines
()).
validate
()
except
ValueError
:
# l.split returns 1 item instead of 2
raise
InvalidPointer
(
_
(
'
cannot parse git-lfs text: %r
'
)
%
text
)
raise
InvalidPointer
(
_
(
'
cannot parse git-lfs text: %s
'
)
%
stringutil
.
pprint
(
text
,
bprefix
=
False
))
def
serialize
(
self
):
sortkeyfunc
=
lambda
x
:
(
x
[
0
]
!=
'
version
'
,
x
)
...
...
@@ -61,8 +66,9 @@
for
k
,
v
in
self
.
iteritems
():
if
k
in
self
.
_requiredre
:
if
not
self
.
_requiredre
[
k
].
match
(
v
):
raise
InvalidPointer
(
_
(
'
unexpected value: %s=%r
'
)
%
(
k
,
v
))
raise
InvalidPointer
(
_
(
'
unexpected value: %s=%s
'
)
%
(
k
,
stringutil
.
pprint
(
v
,
bprefix
=
False
)))
requiredcount
+=
1
elif
not
self
.
_keyre
.
match
(
k
):
raise
InvalidPointer
(
_
(
'
unexpected key: %s
'
)
%
k
)
if
not
self
.
_valuere
.
match
(
v
):
...
...
@@ -65,8 +71,9 @@
requiredcount
+=
1
elif
not
self
.
_keyre
.
match
(
k
):
raise
InvalidPointer
(
_
(
'
unexpected key: %s
'
)
%
k
)
if
not
self
.
_valuere
.
match
(
v
):
raise
InvalidPointer
(
_
(
'
unexpected value: %s=%r
'
)
%
(
k
,
v
))
raise
InvalidPointer
(
_
(
'
unexpected value: %s=%s
'
)
%
(
k
,
stringutil
.
pprint
(
v
,
bprefix
=
False
)))
if
len
(
self
.
_requiredre
)
!=
requiredcount
:
miss
=
sorted
(
set
(
self
.
_requiredre
.
keys
()).
difference
(
self
.
keys
()))
raise
InvalidPointer
(
_
(
'
missed keys: %s
'
)
%
'
,
'
.
join
(
miss
))
...
...
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