mirror of
https://github.com/frej/fast-export.git
synced 2025-11-03 17:55:49 +01:00
Don't deal with the node in get_changeset()
It's not necessary. It could be fetched with repo[rev].node(), but why bother? Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
@@ -296,7 +296,7 @@ def export_commit(ui,repo,revision,old_marks,max,count,authors,
|
|||||||
brmap[name]=n
|
brmap[name]=n
|
||||||
return n
|
return n
|
||||||
|
|
||||||
(revnode,_,user,(time,timezone),files,desc,branch,extra)=get_changeset(ui,repo,revision,authors,encoding)
|
(_,user,(time,timezone),files,desc,branch,extra)=get_changeset(ui,repo,revision,authors,encoding)
|
||||||
if repo[revision].hidden():
|
if repo[revision].hidden():
|
||||||
return count
|
return count
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ def export_commit(ui,repo,revision,old_marks,max,count,authors,
|
|||||||
return checkpoint(count)
|
return checkpoint(count)
|
||||||
|
|
||||||
def export_note(ui,repo,revision,count,authors,encoding,is_first):
|
def export_note(ui,repo,revision,count,authors,encoding,is_first):
|
||||||
(revnode,_,user,(time,timezone),_,_,_,_)=get_changeset(ui,repo,revision,authors,encoding)
|
(_,user,(time,timezone),_,_,_,_)=get_changeset(ui,repo,revision,authors,encoding)
|
||||||
if repo[revision].hidden():
|
if repo[revision].hidden():
|
||||||
return count
|
return count
|
||||||
|
|
||||||
|
|||||||
11
hg2git.py
11
hg2git.py
@@ -81,22 +81,13 @@ def get_branch(name):
|
|||||||
return name
|
return name
|
||||||
|
|
||||||
def get_changeset(ui,repo,revision,authors={},encoding=''):
|
def get_changeset(ui,repo,revision,authors={},encoding=''):
|
||||||
# Starting with Mercurial 4.6 lookup no longer accepts raw hashes
|
|
||||||
# for lookups. Work around it by changing our behaviour depending on
|
|
||||||
# how it fails
|
|
||||||
try:
|
|
||||||
node=repo.lookup(revision)
|
|
||||||
except (TypeError, hgerror.ProgrammingError):
|
|
||||||
node=binnode(revsymbol(repo, b"%d" % revision)) # We were given a numeric rev
|
|
||||||
except hgerror.RepoLookupError:
|
|
||||||
node=revision # We got a raw hash
|
|
||||||
(manifest,user,(time,timezone),files,desc,extra)=repo.changelog.read(revision)
|
(manifest,user,(time,timezone),files,desc,extra)=repo.changelog.read(revision)
|
||||||
if encoding:
|
if encoding:
|
||||||
user=user.decode(encoding).encode('utf8')
|
user=user.decode(encoding).encode('utf8')
|
||||||
desc=desc.decode(encoding).encode('utf8')
|
desc=desc.decode(encoding).encode('utf8')
|
||||||
tz=b"%+03d%02d" % (-timezone // 3600, ((-timezone % 3600) // 60))
|
tz=b"%+03d%02d" % (-timezone // 3600, ((-timezone % 3600) // 60))
|
||||||
branch=get_branch(extra.get(b'branch', b''))
|
branch=get_branch(extra.get(b'branch', b''))
|
||||||
return (node,manifest,fixup_user(user,authors),(time,tz),files,desc,branch,extra)
|
return (manifest,fixup_user(user,authors),(time,tz),files,desc,branch,extra)
|
||||||
|
|
||||||
def mangle_key(key):
|
def mangle_key(key):
|
||||||
return key
|
return key
|
||||||
|
|||||||
Reference in New Issue
Block a user