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
Admin message
This instance will be upgraded to Heptapod 17.9.0rc1 on 2025-03-27 between 17:00 and 18:00 UTC+2
Show more breadcrumbs
mercurial
hg-git
Commits
173e738d0da4
Commit
173e738d0da4
authored
15 years ago
by
Scott Chacon
Browse files
Options
Downloads
Patches
Plain Diff
remote management tools
parent
f0daee676e10
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
TODO.txt
+3
-10
3 additions, 10 deletions
TODO.txt
__init__.py
+31
-10
31 additions, 10 deletions
__init__.py
git_handler.py
+20
-1
20 additions, 1 deletion
git_handler.py
with
54 additions
and
21 deletions
TODO.txt
+
3
−
10
View file @
173e738d
GENERAL
==========
* remote management
* submodules?
* switch object mapping to hg->git since the many to one is that direction
* file modes
...
...
@@ -10,15 +9,9 @@
PUSH
==========
* get a list of all the hg changesets not yet mapped
* create git objects from each changeset (incl trees/blobs)
- add metadata to commits (branch names, explicit file names)
* update mapfile with new changeset/commit mapping
* connect to server pushing to
- figure out needs (use heads/bookmarks for haves)
* create packfile with needed objects
- some delta compression if possible (?)
* upload packfile, remove temp packfile
* update 'remote' references after push confirmation
* push confirmation? is there extra data after the packfile upload?
* output something after process is complete
* convert tags to git
...
...
This diff is collapsed.
Click to expand it.
__init__.py
+
31
−
10
View file @
173e738d
...
...
@@ -44,6 +44,6 @@
node
=
git
.
remote_head
(
'
origin
'
)
hg
.
update
(
dest_repo
,
node
)
def
gpush
(
ui
,
repo
,
remote_name
=
'
origin
'
):
def
gpush
(
ui
,
repo
,
remote_name
=
'
origin
'
,
branch
=
None
):
git
=
GitHandler
(
repo
,
ui
)
git
.
push
(
remote_name
)
...
...
@@ -48,3 +48,24 @@
git
=
GitHandler
(
repo
,
ui
)
git
.
push
(
remote_name
)
def
gremote
(
ui
,
repo
,
*
args
):
git
=
GitHandler
(
repo
,
ui
)
if
len
(
args
)
==
0
:
git
.
remote_list
()
else
:
verb
=
args
[
0
]
nick
=
args
[
1
]
if
verb
==
'
add
'
:
if
args
[
2
]:
git
.
remote_add
(
nick
,
args
[
2
])
else
:
repo
.
ui
.
warn
(
_
(
"
must supply a url to add as a remote
\n
"
))
elif
verb
==
'
rm
'
:
git
.
remote_remove
(
nick
)
elif
verb
==
'
show
'
:
git
.
remote_show
(
nick
)
else
:
repo
.
ui
.
warn
(
_
(
"
unrecognized command to gremote
\n
"
))
...
...
@@ -50,7 +71,7 @@
def
g
pull
(
ui
,
repo
):
def
g
fetch
(
ui
,
repo
):
dest_repo
.
ui
.
status
(
_
(
"
pulling from git url
\n
"
))
commands
.
norepo
+=
"
gclone
"
cmdtable
=
{
"
gclone
"
:
...
...
@@ -52,12 +73,10 @@
dest_repo
.
ui
.
status
(
_
(
"
pulling from git url
\n
"
))
commands
.
norepo
+=
"
gclone
"
cmdtable
=
{
"
gclone
"
:
(
gclone
,
[
#('A', 'authors', '', 'username mapping filename'),
],
'
Clone a git repository into an hg repository.
'
,
(
gclone
,
[],
_
(
'
Clone a git repository into an hg repository.
'
),
),
"
gpush
"
:
(
gpush
,
[],
_
(
'
hg gpush remote
'
)),
...
...
@@ -61,8 +80,10 @@
),
"
gpush
"
:
(
gpush
,
[],
_
(
'
hg gpush remote
'
)),
"
gpull
"
:
(
gpull
,
[(
'
m
'
,
'
merge
'
,
None
,
_
(
'
merge automatically
'
))],
_
(
'
hg gpull [--merge] remote
'
)),
"
gfetch
"
:
(
gfetch
,
[],
#[('m', 'merge', None, _('merge automatically'))],
_
(
'
hg gfetch remote
'
)),
"
gremote
"
:
(
gremote
,
[],
_
(
'
hg gremote add remote (url)
'
)),
}
This diff is collapsed.
Click to expand it.
git_handler.py
+
20
−
1
View file @
173e738d
...
...
@@ -124,8 +124,7 @@
self
.
upload_pack
(
remote_name
)
self
.
save_map
()
# TODO: make these actually save and recall
def
remote_add
(
self
,
remote_name
,
git_url
):
self
.
_config
[
'
remote.
'
+
remote_name
+
'
.url
'
]
=
git_url
self
.
save_config
()
...
...
@@ -128,7 +127,27 @@
def
remote_add
(
self
,
remote_name
,
git_url
):
self
.
_config
[
'
remote.
'
+
remote_name
+
'
.url
'
]
=
git_url
self
.
save_config
()
def
remote_remove
(
self
,
remote_name
):
key
=
'
remote.
'
+
remote_name
+
'
.url
'
if
key
in
self
.
_config
:
del
self
.
_config
[
key
]
self
.
save_config
()
def
remote_show
(
self
,
remote_name
):
key
=
'
remote.
'
+
remote_name
+
'
.url
'
if
key
in
self
.
_config
:
name
=
self
.
_config
[
key
]
print
"
URL for
"
+
remote_name
+
"
:
"
+
name
else
:
print
"
No remote named :
"
+
remote_name
return
def
remote_list
(
self
):
for
key
,
value
in
self
.
_config
.
iteritems
():
if
key
[
0
:
6
]
==
'
remote
'
:
print
key
+
"
\t
"
+
value
def
remote_name_to_url
(
self
,
remote_name
):
return
self
.
_config
[
'
remote.
'
+
remote_name
+
'
.url
'
]
...
...
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