Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
hg-git
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
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
hg-git
Commits
3636583c
Commit
3636583c
authored
6 years ago
by
Kevin Bullock
Browse files
Options
Downloads
Patches
Plain Diff
verify: update to use makeprogress()
parent
9a6683d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hggit/verify.py
+27
-28
27 additions, 28 deletions
hggit/verify.py
with
27 additions
and
28 deletions
hggit/verify.py
+
27
−
28
View file @
3636583c
...
...
@@ -13,6 +13,8 @@
from
dulwich
import
diff_tree
from
dulwich.objects
import
Commit
,
S_IFGITLINK
import
compat
def
verify
(
ui
,
repo
,
hgctx
):
'''
verify that a Mercurial rev matches the corresponding Git rev
...
...
@@ -53,16 +55,15 @@
hgfiles
.
discard
(
'
.hgsub
'
)
gitfiles
=
set
()
i
=
0
for
gitfile
,
dummy
in
diff_tree
.
walk_trees
(
handler
.
git
.
object_store
,
gitcommit
.
tree
,
None
):
if
gitfile
.
mode
==
dirkind
:
continue
# TODO deal with submodules
if
(
gitfile
.
mode
==
S_IFGITLINK
or
gitfile
.
path
==
'
.hgsubstate
'
or
gitfile
.
path
==
'
.hgsub
'
):
continue
ui
.
progress
(
'
verify
'
,
i
,
total
=
len
(
hgfiles
))
i
+=
1
gitfiles
.
add
(
gitfile
.
path
)
with
compat
.
makeprogress
(
ui
,
'
verify
'
,
total
=
len
(
hgfiles
))
as
progress
:
for
gitfile
,
dummy
in
diff_tree
.
walk_trees
(
handler
.
git
.
object_store
,
gitcommit
.
tree
,
None
):
if
gitfile
.
mode
==
dirkind
:
continue
# TODO deal with submodules
if
(
gitfile
.
mode
==
S_IFGITLINK
or
gitfile
.
path
==
'
.hgsubstate
'
or
gitfile
.
path
==
'
.hgsub
'
):
continue
progress
.
increment
()
gitfiles
.
add
(
gitfile
.
path
)
...
...
@@ -68,7 +69,7 @@
try
:
fctx
=
hgctx
[
gitfile
.
path
]
except
error
.
LookupError
:
# we'll deal with this at the end
continue
try
:
fctx
=
hgctx
[
gitfile
.
path
]
except
error
.
LookupError
:
# we'll deal with this at the end
continue
...
...
@@ -74,15 +75,13 @@
hgflags
=
fctx
.
flags
()
gitflags
=
handler
.
convert_git_int_mode
(
gitfile
.
mode
)
if
hgflags
!=
gitflags
:
ui
.
write
(
_
(
"
file has different flags: %s (hg
'
%s
'
, git
'
%s
'
)
\n
"
)
%
(
gitfile
.
path
,
hgflags
,
gitflags
))
failed
=
True
if
fctx
.
data
()
!=
handler
.
git
[
gitfile
.
sha
].
data
:
ui
.
write
(
_
(
'
difference in: %s
\n
'
)
%
gitfile
.
path
)
failed
=
True
ui
.
progress
(
'
verify
'
,
None
,
total
=
len
(
hgfiles
))
hgflags
=
fctx
.
flags
()
gitflags
=
handler
.
convert_git_int_mode
(
gitfile
.
mode
)
if
hgflags
!=
gitflags
:
ui
.
write
(
_
(
"
file has different flags: %s (hg
'
%s
'
, git
'
%s
'
)
\n
"
)
%
(
gitfile
.
path
,
hgflags
,
gitflags
))
failed
=
True
if
fctx
.
data
()
!=
handler
.
git
[
gitfile
.
sha
].
data
:
ui
.
write
(
_
(
'
difference in: %s
\n
'
)
%
gitfile
.
path
)
failed
=
True
if
hgfiles
!=
gitfiles
:
failed
=
True
...
...
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