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
cee0473e
Commit
cee0473e
authored
15 years ago
by
Scott Chacon
Browse files
Options
Downloads
Patches
Plain Diff
remove profiling code and cache all trees more effectively
parent
4286209d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
__init__.py
+1
-18
1 addition, 18 deletions
__init__.py
dulwich/repo.py
+7
-1
7 additions, 1 deletion
dulwich/repo.py
with
8 additions
and
19 deletions
__init__.py
+
1
−
18
View file @
cee0473e
...
...
@@ -35,9 +35,7 @@
hg_repo_path
+=
'
-hg
'
dest_repo
=
hg
.
repository
(
ui
,
hg_repo_path
,
create
=
True
)
print
dest_repo
# fetch the initial git data
git
=
GitHandler
(
dest_repo
,
ui
)
git
.
remote_add
(
'
origin
'
,
git_url
)
...
...
@@ -40,23 +38,8 @@
# fetch the initial git data
git
=
GitHandler
(
dest_repo
,
ui
)
git
.
remote_add
(
'
origin
'
,
git_url
)
import
cProfile
,
pstats
import
lsprofcalltree
prof
=
cProfile
.
Profile
()
prof
=
prof
.
runctx
(
"
git.fetch(
'
origin
'
)
"
,
globals
(),
locals
())
stats
=
pstats
.
Stats
(
prof
)
k
=
lsprofcalltree
.
KCacheGrind
(
prof
)
data
=
open
(
'
/tmp/prof.kgrind
'
,
'
w+
'
)
k
.
output
(
data
)
data
.
close
()
stats
.
sort_stats
(
"
cumulative
"
)
# Or cumulative
stats
.
print_stats
(
80
)
# 80 = how many to print
# The rest is optional.
#stats.print_callees()
#stats.print_callers()
#git.fetch('origin')
git
.
fetch
(
'
origin
'
)
# checkout the tip
node
=
git
.
remote_head
(
'
origin
'
)
...
...
This diff is collapsed.
Click to expand it.
dulwich/repo.py
+
7
−
1
View file @
cee0473e
...
...
@@ -108,6 +108,7 @@
self
.
path
=
root
self
.
tags
=
Tags
(
self
.
tagdir
(),
self
.
get_tags
())
self
.
_object_store
=
None
self
.
tree_cache
=
{}
def
controldir
(
self
):
"""
Return the path of the control directory.
"""
...
...
@@ -315,7 +316,12 @@
return
ret
def
get_object
(
self
,
sha
):
return
self
.
object_store
[
sha
]
if
sha
in
self
.
tree_cache
:
return
self
.
tree_cache
[
sha
]
obj
=
self
.
object_store
[
sha
]
if
obj
.
_type
==
'
tree
'
:
self
.
tree_cache
[
sha
]
=
obj
return
obj
def
get_parents
(
self
,
sha
):
return
self
.
commit
(
sha
).
parents
...
...
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