Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hg-git
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
heptapod
hg-git
Commits
5c1d4311440d
Commit
5c1d4311440d
authored
12 years ago
by
durin42
Browse files
Options
Downloads
Patches
Plain Diff
submodules: only use the ordereddict backport if collections.OrderedDict is unavailable
parent
64eb2789e5bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hggit/git_handler.py
+1
-2
1 addition, 2 deletions
hggit/git_handler.py
hggit/util.py
+6
-4
6 additions, 4 deletions
hggit/util.py
setup.py
+7
-1
7 additions, 1 deletion
setup.py
with
14 additions
and
7 deletions
hggit/git_handler.py
+
1
−
2
View file @
5c1d4311
import
os
,
math
,
urllib
,
re
import
stat
,
posixpath
,
StringIO
import
ordereddict
from
dulwich.errors
import
HangupException
,
GitProtocolError
from
dulwich.index
import
commit_tree
...
...
@@ -503,7 +502,7 @@
def
iterblobs
(
self
,
ctx
):
if
'
.hgsubstate
'
in
ctx
:
hgsub
=
ordereddict
.
OrderedDict
()
hgsub
=
util
.
OrderedDict
()
if
'
.hgsub
'
in
ctx
:
hgsub
=
util
.
parse_hgsub
(
ctx
[
'
.hgsub
'
].
data
().
splitlines
())
hgsubstate
=
util
.
parse_hgsubstate
(
ctx
[
'
.hgsubstate
'
].
data
().
splitlines
())
...
...
This diff is collapsed.
Click to expand it.
hggit/util.py
+
6
−
4
View file @
5c1d4311
"""
Compatability functions for old Mercurial versions.
"""
import
ordereddict
try
:
from
collections
import
OrderedDict
except
ImportError
:
from
ordereddict
import
OrderedDict
def
progress
(
ui
,
*
args
,
**
kwargs
):
"""
Shim for progress on hg < 1.4. Remove when 1.3 is dropped.
"""
...
...
@@ -7,7 +10,7 @@
def
parse_hgsub
(
lines
):
"""
Fills OrderedDict with hgsub file content passed as list of lines
"""
rv
=
ordereddict
.
OrderedDict
()
rv
=
OrderedDict
()
for
l
in
lines
:
ls
=
l
.
strip
();
if
not
ls
or
ls
[
0
]
==
'
#
'
:
continue
...
...
@@ -21,7 +24,7 @@
def
parse_hgsubstate
(
lines
):
"""
Fills OrderedDict with hgsubtate file content passed as list of lines
"""
rv
=
ordereddict
.
OrderedDict
()
rv
=
OrderedDict
()
for
l
in
lines
:
ls
=
l
.
strip
();
if
not
ls
or
ls
[
0
]
==
'
#
'
:
continue
...
...
@@ -32,4 +35,3 @@
def
serialize_hgsubstate
(
data
):
"""
Produces a string from OrderedDict hgsubstate content
"""
return
''
.
join
([
'
%s %s
\n
'
%
(
data
[
n
],
n
)
for
n
in
sorted
(
data
)])
This diff is collapsed.
Click to expand it.
setup.py
+
7
−
1
View file @
5c1d4311
...
...
@@ -3,6 +3,12 @@
except
:
from
distutils.core
import
setup
try
:
from
collections
import
OrderedDict
extra_req
=
[]
except
ImportError
:
extra_req
=
'
ordereddict>=1.1
'
setup
(
name
=
'
hg-git
'
,
version
=
'
0.4.0
'
,
...
...
@@ -19,5 +25,5 @@
keywords
=
'
hg git mercurial
'
,
license
=
'
GPLv2
'
,
packages
=
[
'
hggit
'
],
install_requires
=
[
'
dulwich>=0.8.0
'
,
'
ordereddict>=1.1
'
]
,
install_requires
=
[
'
dulwich>=0.8.0
'
]
+
extra_req
,
)
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