changeset 72:7d5fbed25b36

merge with a rename is working now, but the fix cannot be the right way to do it
author Scott Chacon <schacon@gmail.com>
date Fri, 01 May 2009 07:00:44 -0700
parents 19053d11d520
children 466ebe5a157d
files TODO.txt git_handler.py
diffstat 2 files changed, 21 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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
 ===========
--- 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,