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
0a514e30
Commit
0a514e30
authored
11 years ago
by
durin42
Browse files
Options
Downloads
Patches
Plain Diff
overlay: add kludge to make sure we only ever give hexshas to dulwich
parent
f6cd1f0e
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/overlay.py
+8
-3
8 additions, 3 deletions
hggit/overlay.py
with
8 additions
and
3 deletions
hggit/overlay.py
+
8
−
3
View file @
0a514e30
...
...
@@ -10,6 +10,11 @@
from
mercurial.node
import
bin
,
hex
,
nullid
from
mercurial
import
localrepo
def
_maybehex
(
n
):
if
len
(
n
)
==
20
:
return
hex
(
n
)
return
n
class
overlaymanifest
(
object
):
def
__init__
(
self
,
repo
,
sha
):
self
.
repo
=
repo
...
...
@@ -103,7 +108,7 @@
return
self
.
fileid
def
data
(
self
):
blob
=
self
.
repo
.
handler
.
git
.
get_object
(
self
.
fileid
)
blob
=
self
.
repo
.
handler
.
git
.
get_object
(
_maybehex
(
self
.
fileid
)
)
return
blob
.
data
class
overlaychangectx
(
context
.
changectx
):
...
...
@@ -111,7 +116,7 @@
self
.
repo
=
repo
if
not
isinstance
(
sha
,
basestring
):
sha
=
sha
.
hex
()
self
.
commit
=
repo
.
handler
.
git
.
get_object
(
sha
)
self
.
commit
=
repo
.
handler
.
git
.
get_object
(
_maybehex
(
sha
)
)
self
.
_overlay
=
getattr
(
repo
,
'
gitoverlay
'
,
repo
)
self
.
_rev
=
self
.
_overlay
.
rev
(
bin
(
self
.
commit
.
id
))
...
...
@@ -185,7 +190,7 @@
if
not
gitrev
:
# we've reached a revision we have
return
self
.
base
.
parents
(
n
)
commit
=
self
.
repo
.
handler
.
git
.
get_object
(
n
)
commit
=
self
.
repo
.
handler
.
git
.
get_object
(
_maybehex
(
n
)
)
def
gitorhg
(
n
):
hn
=
self
.
repo
.
handler
.
map_hg_get
(
hex
(
n
))
...
...
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