Comment #2 on issue 2971 by c.caug...@gmail.com: Can't view Mercurial diffs
with parent diffs in recent versions
I've investigated further; the issue was introduced by this changeset here:
I've got it working again in our environment by not passing the limit_to
argument to _process_files at line 108 of diffviewer/forms.py.
I believe the problem is that with Mercurial this prevents the
source_revision field of the FileDiff from being set correctly for any
files that are present in the main diff but not in the parent diff.
I'm guessing this change was made with git in mind. Git diffs are a little
different from Mercurial diffs (even Mercurial "git-style" diffs) in that
(afaik) they record the original revision ID *of every file in the diff*.
That means that if the parent diff doesn't mention a file, the original
version of that file can be found without even looking at the parent diff.
Mercurial diffs (and revision numbers for that matter) are different. First
remember that in Mercurial there are no file revisions, only whole-repo
revisions. A particular revision of a file is identified by the changeset
that introduced the new file revision.
Therefore a Mercurial diff only identifies the repo revision it is based
on, not the revisions of each file within it. In the case of a
diff/parent_diff pair, the source revision of the main diff will be the
destination revision of the parent diff, which by definition doesn't exist
in the repository that ReviewBoard can see.
So, for parent diffs to work with Mercurial, the source revision ID of all
files in the diff must be set to the source revision of the parent diff,
regardless of whether or not they appear in the parent diff.
I'm not sure of the best way to fix this. It seems like the code to handle
the differences between Git and Mercurial should be in the various SCMTool
subclasses, but I think that means SCMTool will have to gain methods to
process parent diffs. I'll mull this over and propose a fix, in the mean
time if you have any suggestions I'd be glad to hear them.
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to firstname.lastname@example.org.
Visit this group at http://groups.google.com/group/reviewboard-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.