Forum Discussion

msabo's avatar
12 years ago

Mercurial Integration and Code Reviews

I'm looking for guidance on how we can leverage

CodeCollaborator7 client software with Mercurial successfully. We are having

trouble getting the following scenarios listed below to run successfully. Our

practice is to Commit the file changes to our local repositories then submit

those changes for code review before merging to the master repository. I've

reviewed the documentation on the support site and believe we need to use the ‘Add

Mercurial Diffs..’ feature. There are a couple of commands here -r and -c, what

configuration of these commands are required for each of the three scenarios

below. For item 1 the -c with the revision number for review works successfully.

I've had less luck in getting using the -r command for the subsequent


1. Initial submission

2. Follow up submission

3. Submissions with were external revisions brought in between reviews (less likely, but could happen)


1 Reply

  • When you choose to add a mercurial diff, we pass the diff arguments to 'hg diff' and create a review from the resulting output. 

    Thus, the -r and -c options are really just the -r and -c options from mercurial.  They're different ways of specifying a revision, or a pair of revisions to commands that need that. 

    -c (or --change) is a shorthand way to reference "change(s) made by a revision".  

    So the command: 

    hg diff -c 2

    will show a diff of the changes introduced by revision 2.  This is equivalent to (and likely just shorthand for) showing the differences between the old version (1) and the new version (2), which can be written like this: 

    hg diff -r 1 -r 2


    hg diff -r 1:2. 

    So to answer your questions #1 and #2: the format is the same.  If you added change 2 to a review (-c 2) then you made a new change to fix issues in the review, add it the same way, (-c 3).  

    I'd recommend against #3 -- adding someone else's files/diffs to your current review will likely just clutter up your review.  It's probably best to review those changes in their own review.