1235: More intelligent handling of rename operations.
- Fixed
- Review Board
josh.h*******@gmai***** (Google Code) (Is this you? Claim this profile.) | |
Jan. 18, 2014 | |
1089 |
board.org/ What version are you running? 1.0 What's the URL of the page this enhancement relates to, if any? Any review request. Describe the enhancement and the motivation for it. Most SCM systems have some concept of a rename operation: 'svn mv' 'p4 integrate/p4 delete' 'git mv' These operations generally end up being shown as a deleted file/added file by ReviewBoard (and most code review systems in general). It would be very slick if there was sufficient intelligence to detect this situation and only show differences between the files rather than the add/delete. What operating system are you using? What browser? N/A Please provide any additional information below.
Note that for the git world a good starting point is 'git diff --full-index -M master'. As well as mentioning renames, it actually gives the diff between the before- and after-move paths. (Currently in v1.5, you can't upload such a diff into reviewboard: it sees a diff between "a/old/path" and "b/new/path", and complains that "old/path (revision )" doesn't exist in the repository.) I currently have a 600kB diff in review that reduces to 100kB with -M. It involves moving some 40 files, each with small differences as well as the move (primarily the class name). Resolving this may also link to <a href="http://code.google.com/p/reviewboard/issues/detail?id=1066">issue 1066</a>.
Mercurial can also provide rename information in the patch when doing "hg diff -g" to give git style diffs.
Can you elaborate? Uploading a git-style patch generated by 'hg diff -g' causes exceptions when trying to view the diff. Uploading a standard diff doesn't get renames picked up. I'm running reviewboard "1.6 RC2"
there is still an issue with pure file rename in mercurial http://code.google.com/p/reviewboard/issues/detail?id=2184
The review I am trying has both rename and modifications so I don't think its the same issue. I see that thread mentions using 'hg export -g', which I wasn't doing. Note: the export in that thread appears to be for a single commit. We typically do reviews on a branch that is going to merge, having multiple commits. Thus I tried for example: 'hg export -g tip:50324 > merge-review.patch' Reviewboard won't even allow that resultant patch-file to be uploaded saying file of first change in the patch can't be found.
Ok, so I rediscovered that adding the #NoteID / #Parent Id to the git-diff patch allows reviewboard to get this needed info. Also found a reviewboard mercurial extension that does the same. I'll be making my own simple extension that just does the patch generation.
It seems this issue is actually fixed in at least 1.6 RC2. uploading a patch as: 'git diff --full-index -M' works fine. The outstanding issue is handling renames without modify, add and delete of empty files. I've comments put in Issue 2184.
Here's a sample mecurial extension that generates the required diff format for reviewboard including renames. It's a quick hack which needs cleanup. Also supports generating 'parent diff' if a review is based on a yet to be merged previous review.
-
+
I try to generate "git diff -M --full-index revA revB" but the patch is not accepted by RB with error: The file 'path/to/fileB' (r) could not be found in the repository Where could be the problem? I'll try to add # Node ID/ # Parent at the top of diff file but no success (same result), if I try to prepend before line Similarity index 100% a line index revA..revB 100644 the error is only more concrete: The file 'path/to/fileB' (revA) could not be found in the repository I suppose that fileB should be searched in revB not revA. Thank for any advice (We use RB v1.6.4.1).