# HG changeset patch # User Scott Chacon # Date 1241186444 25200 # Node ID 7d5fbed25b36d86dc55d3354ca51e0269161a28d # Parent 19053d11d520f50354f0a34358d3412974532a24 merge with a rename is working now, but the fix cannot be the right way to do it diff --git a/TODO.txt b/TODO.txt --- a/TODO.txt +++ b/TODO.txt @@ -4,6 +4,7 @@ - hg push git@... - hg fetch [remote] (remote is url, hg alias or hg-git remote) - hg clone url +* fail nicely when the remote_name is not there * more tests * submodules? * .gitignore, etc - try to convert? @@ -23,12 +24,13 @@ MAPPING ISSUES ============== Created in Hg: -* named branches -* merges (dont convert back properly for some reason) +* named branches # +* merges with renames - dont convert back properly for some reason Created in Git: +* different committer in Git objects +* encoding field * octopus merge explode/implode -* different committer in Git objects WEBSITE =========== diff --git a/git_handler.py b/git_handler.py --- a/git_handler.py +++ b/git_handler.py @@ -523,11 +523,24 @@ # TODO : map extra parents to the extras file pass - files = self.git.get_files_changed(commit) + # if committer is different than author, add it to extra + extra = {} + if not ((commit.author == commit.committer) and (commit.author_time == commit.commit_time)): + cdate = datetime.datetime.fromtimestamp(commit.commit_time).strftime("%Y-%m-%d %H:%M:%S") + extra['committer'] = commit.committer + extra['commit_time'] = cdate # get a list of the changed, added, removed files - extra = {} - # *TODO : if committer is different than author, add it to extra + files = self.git.get_files_changed(commit) + + # if this is a merge commit, don't list renamed files + # i'm really confused here - this is the only way my use case will + # work, but it seems really hacky - do I need to just remove renames + # from one of the parents? AARRGH! + if not (p2 == "0"*40): + for removefile in hg_renames.values(): + files.remove(removefile) + text = strip_message date = datetime.datetime.fromtimestamp(commit.author_time).strftime("%Y-%m-%d %H:%M:%S") ctx = context.memctx(self.repo, (p1, p2), text, files, getfilectx,