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
e35ed99f
Commit
e35ed99f
authored
15 years ago
by
Scott Chacon
Browse files
Options
Downloads
Patches
Plain Diff
committer info now being kept properly
parent
52b4be85
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
dulwich/objects.py
+7
-1
7 additions, 1 deletion
dulwich/objects.py
git_handler.py
+13
-4
13 additions, 4 deletions
git_handler.py
with
21 additions
and
7 deletions
TODO.txt
+
1
−
2
View file @
e35ed99f
...
@@ -27,8 +27,7 @@
...
@@ -27,8 +27,7 @@
- dont convert back properly for some reason
- dont convert back properly for some reason
Created in Git:
Created in Git:
* different committer in Git objects
* encoding field / utf-8
* encoding field
* octopus merge explode/implode
* octopus merge explode/implode
WEBSITE
WEBSITE
...
...
This diff is collapsed.
Click to expand it.
dulwich/objects.py
+
7
−
1
View file @
e35ed99f
...
@@ -544,7 +544,8 @@
...
@@ -544,7 +544,8 @@
self
.
_author
+=
text
[
count
]
self
.
_author
+=
text
[
count
]
count
+=
1
count
+=
1
self
.
_author
+=
text
[
count
]
self
.
_author
+=
text
[
count
]
self
.
_author_raw
=
self
.
_author
count
+=
1
count
+=
1
assert
text
[
count
]
==
'
'
,
"
Invalid commit object,
"
\
assert
text
[
count
]
==
'
'
,
"
Invalid commit object,
"
\
"
author information must be followed by space not %s
"
%
text
[
count
]
"
author information must be followed by space not %s
"
%
text
[
count
]
count
+=
1
count
+=
1
...
@@ -547,8 +548,9 @@
...
@@ -547,8 +548,9 @@
count
+=
1
count
+=
1
assert
text
[
count
]
==
'
'
,
"
Invalid commit object,
"
\
assert
text
[
count
]
==
'
'
,
"
Invalid commit object,
"
\
"
author information must be followed by space not %s
"
%
text
[
count
]
"
author information must be followed by space not %s
"
%
text
[
count
]
count
+=
1
count
+=
1
self
.
_author_raw
+=
'
'
+
text
[
count
:].
split
(
"
"
,
1
)[
0
]
self
.
_author_time
=
int
(
text
[
count
:].
split
(
"
"
,
1
)[
0
])
self
.
_author_time
=
int
(
text
[
count
:].
split
(
"
"
,
1
)[
0
])
while
text
[
count
]
!=
'
'
:
while
text
[
count
]
!=
'
'
:
assert
text
[
count
]
!=
'
\n
'
,
"
Malformed author information
"
assert
text
[
count
]
!=
'
\n
'
,
"
Malformed author information
"
count
+=
1
count
+=
1
...
@@ -551,7 +553,8 @@
...
@@ -551,7 +553,8 @@
self
.
_author_time
=
int
(
text
[
count
:].
split
(
"
"
,
1
)[
0
])
self
.
_author_time
=
int
(
text
[
count
:].
split
(
"
"
,
1
)[
0
])
while
text
[
count
]
!=
'
'
:
while
text
[
count
]
!=
'
'
:
assert
text
[
count
]
!=
'
\n
'
,
"
Malformed author information
"
assert
text
[
count
]
!=
'
\n
'
,
"
Malformed author information
"
count
+=
1
count
+=
1
self
.
_author_raw
+=
text
[
count
:
count
+
6
]
self
.
_author_timezone
=
parse_timezone
(
text
[
count
:
count
+
6
])
self
.
_author_timezone
=
parse_timezone
(
text
[
count
:
count
+
6
])
count
+=
1
count
+=
1
while
text
[
count
]
!=
'
\n
'
:
while
text
[
count
]
!=
'
\n
'
:
...
@@ -569,7 +572,8 @@
...
@@ -569,7 +572,8 @@
self
.
_committer
+=
text
[
count
]
self
.
_committer
+=
text
[
count
]
count
+=
1
count
+=
1
self
.
_committer
+=
text
[
count
]
self
.
_committer
+=
text
[
count
]
self
.
_committer_raw
=
self
.
_committer
count
+=
1
count
+=
1
assert
text
[
count
]
==
'
'
,
"
Invalid commit object,
"
\
assert
text
[
count
]
==
'
'
,
"
Invalid commit object,
"
\
"
commiter information must be followed by space not %s
"
%
text
[
count
]
"
commiter information must be followed by space not %s
"
%
text
[
count
]
count
+=
1
count
+=
1
...
@@ -572,8 +576,9 @@
...
@@ -572,8 +576,9 @@
count
+=
1
count
+=
1
assert
text
[
count
]
==
'
'
,
"
Invalid commit object,
"
\
assert
text
[
count
]
==
'
'
,
"
Invalid commit object,
"
\
"
commiter information must be followed by space not %s
"
%
text
[
count
]
"
commiter information must be followed by space not %s
"
%
text
[
count
]
count
+=
1
count
+=
1
self
.
_commit_time
=
int
(
text
[
count
:
count
+
10
])
self
.
_committer_raw
+=
'
'
+
text
[
count
:].
split
(
"
"
,
1
)[
0
]
self
.
_commit_time
=
int
(
text
[
count
:].
split
(
"
"
,
1
)[
0
])
while
text
[
count
]
!=
'
'
:
while
text
[
count
]
!=
'
'
:
assert
text
[
count
]
!=
'
\n
'
,
"
Malformed committer information
"
assert
text
[
count
]
!=
'
\n
'
,
"
Malformed committer information
"
count
+=
1
count
+=
1
...
@@ -577,6 +582,7 @@
...
@@ -577,6 +582,7 @@
while
text
[
count
]
!=
'
'
:
while
text
[
count
]
!=
'
'
:
assert
text
[
count
]
!=
'
\n
'
,
"
Malformed committer information
"
assert
text
[
count
]
!=
'
\n
'
,
"
Malformed committer information
"
count
+=
1
count
+=
1
self
.
_committer_raw
+=
text
[
count
:
count
+
6
]
self
.
_commit_timezone
=
parse_timezone
(
text
[
count
:
count
+
6
])
self
.
_commit_timezone
=
parse_timezone
(
text
[
count
:
count
+
6
])
count
+=
1
count
+=
1
while
text
[
count
]
!=
'
\n
'
:
while
text
[
count
]
!=
'
\n
'
:
...
...
This diff is collapsed.
Click to expand it.
git_handler.py
+
13
−
4
View file @
e35ed99f
...
@@ -197,9 +197,9 @@
...
@@ -197,9 +197,9 @@
# hg authors might not have emails
# hg authors might not have emails
author
=
ctx
.
user
()
author
=
ctx
.
user
()
if
not
'
>
'
in
author
:
if
not
'
>
'
in
author
:
# TODO : this kills losslessness - die (submodules)?
author
=
author
+
'
<none@none>
'
author
=
author
+
'
<none@none>
'
commit
[
'
author
'
]
=
author
+
'
'
+
str
(
int
(
time
))
+
'
'
+
seconds_to_offset
(
timezone
)
commit
[
'
author
'
]
=
author
+
'
'
+
str
(
int
(
time
))
+
'
'
+
seconds_to_offset
(
timezone
)
message
=
ctx
.
description
()
message
=
ctx
.
description
()
commit
[
'
message
'
]
=
ctx
.
description
()
+
"
\n
"
commit
[
'
message
'
]
=
ctx
.
description
()
+
"
\n
"
...
@@ -201,8 +201,12 @@
...
@@ -201,8 +201,12 @@
author
=
author
+
'
<none@none>
'
author
=
author
+
'
<none@none>
'
commit
[
'
author
'
]
=
author
+
'
'
+
str
(
int
(
time
))
+
'
'
+
seconds_to_offset
(
timezone
)
commit
[
'
author
'
]
=
author
+
'
'
+
str
(
int
(
time
))
+
'
'
+
seconds_to_offset
(
timezone
)
message
=
ctx
.
description
()
message
=
ctx
.
description
()
commit
[
'
message
'
]
=
ctx
.
description
()
+
"
\n
"
commit
[
'
message
'
]
=
ctx
.
description
()
+
"
\n
"
extra
=
ctx
.
extra
()
if
'
committer
'
in
extra
:
commit
[
'
committer
'
]
=
extra
[
'
committer
'
]
# HG EXTRA INFORMATION
# HG EXTRA INFORMATION
add_extras
=
False
add_extras
=
False
extra_message
=
''
extra_message
=
''
...
@@ -541,9 +545,7 @@
...
@@ -541,9 +545,7 @@
files
.
remove
(
removefile
)
files
.
remove
(
removefile
)
extra
=
{}
extra
=
{}
# *TODO : if committer is different than author, add it to extra
# if named branch, add to extra
# if named branch, add to extra
if
hg_branch
:
if
hg_branch
:
extra
[
'
branch
'
]
=
hg_branch
extra
[
'
branch
'
]
=
hg_branch
...
@@ -547,6 +549,13 @@
...
@@ -547,6 +549,13 @@
# if named branch, add to extra
# if named branch, add to extra
if
hg_branch
:
if
hg_branch
:
extra
[
'
branch
'
]
=
hg_branch
extra
[
'
branch
'
]
=
hg_branch
# if committer is different than author, add it to extra
if
not
commit
.
_author_raw
==
commit
.
_committer_raw
:
extra
[
'
committer
'
]
=
commit
.
_committer_raw
if
hg_branch
:
extra
[
'
branch
'
]
=
hg_branch
text
=
strip_message
text
=
strip_message
date
=
datetime
.
datetime
.
fromtimestamp
(
commit
.
author_time
).
strftime
(
"
%Y-%m-%d %H:%M:%S
"
)
date
=
datetime
.
datetime
.
fromtimestamp
(
commit
.
author_time
).
strftime
(
"
%Y-%m-%d %H:%M:%S
"
)
...
...
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