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
d67d0073
Commit
d67d0073
authored
15 years ago
by
Scott Chacon
Browse files
Options
Downloads
Patches
Plain Diff
fix message stripping and malformed user info
parent
8bfa8aa6
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
+1
-2
1 addition, 2 deletions
TODO.txt
git_handler.py
+25
-2
25 additions, 2 deletions
git_handler.py
hgrepo.py
+7
-7
7 additions, 7 deletions
hgrepo.py
with
33 additions
and
11 deletions
TODO.txt
+
1
−
2
View file @
d67d0073
...
...
@@ -4,9 +4,9 @@
- hg push git@...
- hg fetch [remote] (remote is url, hg alias or hg-git remote)
- hg clone url
* file:/// support
* work fine with eclipse plugin or tortoise-hg
MAPPING ISSUES
==============
* work in Git on a named branch created in Hg is forward-ported to be named branch commits in Hg and stripped back out if re-exported
...
...
@@ -8,9 +8,8 @@
* work fine with eclipse plugin or tortoise-hg
MAPPING ISSUES
==============
* work in Git on a named branch created in Hg is forward-ported to be named branch commits in Hg and stripped back out if re-exported
* timezone issues (?)
REMOTE/BRANCH STUFF
...
...
This diff is collapsed.
Click to expand it.
git_handler.py
+
25
−
2
View file @
d67d0073
import
os
,
errno
,
sys
,
time
,
datetime
,
pickle
,
copy
,
math
,
urllib
import
os
,
errno
,
sys
,
time
,
datetime
,
pickle
,
copy
,
math
,
urllib
,
re
import
toposort
import
dulwich
from
dulwich.repo
import
Repo
...
...
@@ -255,7 +255,20 @@
# hg authors might not have emails
author
=
ctx
.
user
()
if
not
'
>
'
in
author
:
# check for git author pattern compliance
regex
=
re
.
compile
(
'
^(.*?) \<(.*?)\>(.*)$
'
)
a
=
regex
.
match
(
author
)
if
a
:
name
=
a
.
group
(
1
)
email
=
a
.
group
(
2
)
if
len
(
a
.
group
(
3
))
>
0
:
name
+=
'
ext:(
'
+
urllib
.
quote
(
a
.
group
(
3
))
+
'
)
'
author
=
name
+
'
<
'
+
email
+
'
>
'
print
"
AUTHOR
"
print
author
else
:
author
=
author
+
'
<none@none>
'
commit
[
'
author
'
]
=
author
+
'
'
+
str
(
int
(
time
))
+
'
'
+
format_timezone
(
-
timezone
)
message
=
ctx
.
description
()
...
...
@@ -722,6 +735,16 @@
author
=
commit
.
author
# convert extra data back to the end
if
'
ext:
'
in
commit
.
author
:
regex
=
re
.
compile
(
'
^(.*?)\ ext:\((.*)\) <(.*)\>$
'
)
m
=
regex
.
match
(
commit
.
author
)
if
m
:
name
=
m
.
group
(
1
)
ex
=
urllib
.
unquote
(
m
.
group
(
2
))
email
=
m
.
group
(
3
)
author
=
name
+
'
<
'
+
email
+
'
>
'
+
ex
if
'
<none@none>
'
in
commit
.
author
:
author
=
commit
.
author
[:
-
12
]
...
...
This diff is collapsed.
Click to expand it.
hgrepo.py
+
7
−
7
View file @
d67d0073
...
...
@@ -91,13 +91,13 @@
mn
=
self
.
manifest
.
add
(
m1
,
trp
,
linkrev
,
c1
[
0
],
c2
[
0
],
(
new
,
removed1
))
lines
=
[
line
.
rstrip
()
for
line
in
text
.
rstrip
().
splitlines
()]
while
lines
and
not
lines
[
0
]:
del
lines
[
0
]
if
not
lines
and
use_dirstate
:
raise
util
.
Abort
(
_
(
"
empty commit message
"
))
text
=
'
\n
'
.
join
(
lines
)
#
lines = [line.rstrip() for line in text.rstrip().splitlines()]
#
while lines and not lines[0]:
#
del lines[0]
#text = '\n'.join(lines)
if
text
[
-
1
]
==
"
\n
"
:
text
=
text
[:
-
1
]
file_list
=
[]
if
force_files
==
False
:
file_list
=
[]
...
...
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