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
07f03124
Commit
07f03124
authored
9 years ago
by
Sean Farley
Browse files
Options
Downloads
Patches
Plain Diff
git_handler: remove pre-2.8 code for bookmarks
parent
f33faedc
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/git_handler.py
+6
-22
6 additions, 22 deletions
hggit/git_handler.py
with
6 additions
and
22 deletions
hggit/git_handler.py
+
6
−
22
View file @
07f03124
...
...
@@ -15,12 +15,5 @@
from
dulwich
import
config
as
dul_config
from
dulwich
import
diff_tree
try
:
from
mercurial
import
bookmarks
bookmarks
.
update
from
mercurial
import
commands
except
ImportError
:
from
hgext
import
bookmarks
from
mercurial.i18n
import
_
from
mercurial.node
import
hex
,
bin
,
nullid
...
...
@@ -25,5 +18,7 @@
from
mercurial.i18n
import
_
from
mercurial.node
import
hex
,
bin
,
nullid
from
mercurial
import
bookmarks
from
mercurial
import
commands
from
mercurial
import
context
,
util
as
hgutil
from
mercurial
import
url
...
...
@@ -266,8 +261,8 @@
self
.
update_remote_branches
(
'
default
'
,
refs
)
# "Activate" a tipmost bookmark.
bms
=
getattr
(
self
.
repo
[
'
tip
'
]
,
'
bookmarks
'
,
lambda
:
None
)()
bms
=
self
.
repo
[
'
tip
'
]
.
bookmarks
()
if
bms
:
try
:
bookmarks
.
activate
(
self
.
repo
,
bms
[
0
])
...
...
@@ -1281,11 +1276,7 @@
def
update_hg_bookmarks
(
self
,
refs
):
try
:
oldbm
=
getattr
(
bookmarks
,
'
parse
'
,
None
)
if
oldbm
:
bms
=
bookmarks
.
parse
(
self
.
repo
)
else
:
bms
=
self
.
repo
.
_bookmarks
bms
=
self
.
repo
.
_bookmarks
heads
=
dict
([(
ref
[
11
:],
refs
[
ref
])
for
ref
in
refs
if
ref
.
startswith
(
'
refs/heads/
'
)])
...
...
@@ -1308,14 +1299,7 @@
bms
[
head
+
suffix
]
=
hgsha
if
heads
:
if
oldbm
:
bookmarks
.
write
(
self
.
repo
,
bms
)
else
:
self
.
repo
.
_bookmarks
=
bms
if
getattr
(
bms
,
'
write
'
,
None
):
# hg >= 2.5
bms
.
write
()
else
:
# hg < 2.5
bookmarks
.
write
(
self
.
repo
)
bms
.
write
()
except
AttributeError
:
self
.
ui
.
warn
(
_
(
'
creating bookmarks failed, do you have
'
...
...
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