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
1959fd51
Commit
1959fd51
authored
9 years ago
by
Sean Farley
Browse files
Options
Downloads
Patches
Plain Diff
hg2git: flake8 cleanup
parent
0d258c2d
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/hg2git.py
+16
-14
16 additions, 14 deletions
hggit/hg2git.py
with
16 additions
and
14 deletions
hggit/hg2git.py
+
16
−
14
View file @
1959fd51
...
...
@@ -6,7 +6,6 @@
import
stat
import
dulwich.objects
as
dulobjs
from
dulwich
import
diff_tree
from
mercurial
import
util
as
hgutil
import
compat
...
...
@@ -107,11 +106,12 @@
def
__init__
(
self
,
hg_repo
,
start_ctx
,
git_store
,
git_commit
):
"""
Create an instance against a mercurial.localrepo.
start_ctx is the context for a Mercurial commit that has a Git
equivalent, passed in as git_commit. The incremental computation will be
started from this commit. git_store is the Git object store the commit
comes from. start_ctx can be repo[nullid], in which case git_commit
should be None.
start_ctx: the context for a Mercurial commit that has a Git
equivalent, passed in as git_commit. The incremental
computation will be started from this commit.
git_store: the Git object store the commit comes from.
start_ctx can be repo[nullid], in which case git_commit should be None.
"""
self
.
_hg
=
hg_repo
...
...
@@ -199,7 +199,8 @@
subadded
,
subremoved
=
self
.
_handle_subrepos
(
newctx
)
break
# We first process subrepo and file removals so we can prune dead trees.
# We first process subrepo and file removals so we can prune dead
# trees.
for
path
in
subremoved
:
self
.
_remove_path
(
path
,
dirty_trees
)
...
...
@@ -229,8 +230,8 @@
fctx
=
newctx
[
path
]
entry
,
blob
=
IncrementalChangesetExporter
.
tree_entry
(
fctx
,
self
.
_blob_cache
)
func
=
IncrementalChangesetExporter
.
tree_entry
entry
,
blob
=
func
(
fctx
,
self
.
_blob_cache
)
if
blob
is
not
None
:
yield
(
blob
,
fctx
.
filenode
())
...
...
@@ -373,8 +374,8 @@
#
# All other combinations are 'do nothing'.
#
# git links without corresponding submodule paths are stored as
subrepos
# with a substate but without an entry in .hgsub.
# git links without corresponding submodule paths are stored as
#
subrepos
with a substate but without an entry in .hgsub.
# 'added' is both modified and added
added
,
removed
=
[],
[]
...
...
@@ -393,7 +394,8 @@
for
path
,
sha
in
newsubstate
.
iteritems
():
if
not
isgit
(
newsub
,
path
):
# new = hg or no; the only cases we care about are handled above
# new = hg or no; the only cases we care about are handled
# above
continue
# case (1)
...
...
@@ -426,5 +428,5 @@
else
:
mode
=
0100644
return
(
dulobjs
.
TreeEntry
(
os
.
path
.
basename
(
fctx
.
path
()),
mode
,
blob_id
),
blob
)
return
(
dulobjs
.
TreeEntry
(
os
.
path
.
basename
(
fctx
.
path
()),
mode
,
blob_id
),
blob
)
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