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
6eded2e4
Commit
6eded2e4
authored
14 years ago
by
Augie Fackler
Browse files
Options
Downloads
Patches
Plain Diff
Un-break hg 1.3 by adding a compat layer for progress.
parent
3ab3765d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hggit/__init__.py
+2
-2
2 additions, 2 deletions
hggit/__init__.py
hggit/git_handler.py
+5
-4
5 additions, 4 deletions
hggit/git_handler.py
hggit/util.py
+5
-0
5 additions, 0 deletions
hggit/util.py
with
12 additions
and
6 deletions
hggit/__init__.py
+
2
−
2
View file @
6eded2e4
...
...
@@ -17,7 +17,7 @@
import
os
from
mercurial
import
commands
,
extensions
,
hg
,
util
from
mercurial
import
commands
,
extensions
,
hg
,
util
as
hgutil
from
mercurial.i18n
import
_
import
gitrepo
,
hgrepo
...
...
@@ -32,7 +32,7 @@
_oldlocal
=
hg
.
schemes
[
'
file
'
]
def
_local
(
path
):
p
=
util
.
drop_scheme
(
'
file
'
,
path
)
p
=
hg
util
.
drop_scheme
(
'
file
'
,
path
)
if
(
os
.
path
.
exists
(
os
.
path
.
join
(
p
,
'
.git
'
))
and
not
os
.
path
.
exists
(
os
.
path
.
join
(
p
,
'
.hg
'
))):
return
gitrepo
...
...
This diff is collapsed.
Click to expand it.
hggit/git_handler.py
+
5
−
4
View file @
6eded2e4
...
...
@@ -13,6 +13,7 @@
from
mercurial
import
context
,
util
as
hgutil
from
mercurial
import
error
import
util
class
GitHandler
(
object
):
mapfile
=
'
git-mapfile
'
...
...
@@ -176,7 +177,7 @@
export
=
[
node
for
node
in
nodes
if
not
hex
(
node
)
in
self
.
_map_hg
]
total
=
len
(
export
)
for
i
,
rev
in
enumerate
(
export
):
self
.
ui
.
progress
(
'
import
'
,
i
,
total
=
total
)
util
.
progress
(
self
.
ui
,
'
import
'
,
i
,
total
=
total
)
ctx
=
self
.
repo
.
changectx
(
rev
)
state
=
ctx
.
extra
().
get
(
'
hg-git
'
,
None
)
if
state
==
'
octopus
'
:
...
...
@@ -184,7 +185,7 @@
"
of octopus explosion
\n
"
%
ctx
.
rev
())
continue
self
.
export_hg_commit
(
rev
)
self
.
ui
.
progress
(
'
import
'
,
None
,
total
=
total
)
util
.
progress
(
self
.
ui
,
'
import
'
,
None
,
total
=
total
)
# convert this commit into git objects
...
...
@@ -401,6 +402,6 @@
# import each of the commits, oldest first
total
=
len
(
commits
)
for
i
,
csha
in
enumerate
(
commits
):
self
.
ui
.
progress
(
'
import
'
,
i
,
total
=
total
,
unit
=
'
commits
'
)
util
.
progress
(
self
.
ui
,
'
import
'
,
i
,
total
=
total
,
unit
=
'
commits
'
)
commit
=
convert_list
[
csha
]
self
.
import_git_commit
(
commit
)
...
...
@@ -405,6 +406,6 @@
commit
=
convert_list
[
csha
]
self
.
import_git_commit
(
commit
)
self
.
ui
.
progress
(
'
import
'
,
None
,
total
=
total
,
unit
=
'
commits
'
)
util
.
progress
(
self
.
ui
,
'
import
'
,
None
,
total
=
total
,
unit
=
'
commits
'
)
def
import_git_commit
(
self
,
commit
):
self
.
ui
.
debug
(
_
(
"
importing: %s
\n
"
)
%
commit
.
id
)
...
...
This diff is collapsed.
Click to expand it.
hggit/util.py
0 → 100644
+
5
−
0
View file @
6eded2e4
"""
Compatability functions for old Mercurial versions.
"""
def
progress
(
ui
,
*
args
,
**
kwargs
):
"""
Shim for progress on hg < 1.4. Remove when 1.3 is dropped.
"""
getattr
(
ui
,
'
progress
'
,
lambda
*
x
,
**
kw
:
None
)(
*
args
,
**
kwargs
)
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