Is there a way to review someone's code before they push in Mercurial?

517 views Asked by At

I would like to be able to review other developers code before they push it to central repository. The developers are at remote locations so going to their desk is not an option.

Currently they just push and if there are issues they would rollback. But this is not a good approach since someone can pull before they get a chance to rollback.

5

There are 5 answers

2
kelloti On BEST ANSWER

Mercurial is distributed, and as such should be able to adapt to any workflow. Try designating someone as an integration manager or use the dictator and lieutenants workflow.

0
Tim Delaney On

On my last project, we followed a very branchy development model - every task had a branch named with the task number. Code reviews were performed against the named branch. We explicitly wanted these pushed to the central repository and developers pulled them.

However, no task named branch was merged to the integration branch (in our case default, but it could have been any feature branch) until it had passed code review.

A lot of mercurial developers don't like to use short-lived branches that remain in the repository, but I find it makes it easier to follow the history, especially when looking at the history of a single change - you know that the changes for a particular task are on the associated named branch.

1
Kris On

Perhaps using a shelve extension is a good solution? I'm not very familiar with Mercurial but this might work for you.

https://www.mercurial-scm.org/wiki/ShelveExtension

0
Bert F On

How about review repository between the developers and the main repository? Only you push from there to main.

0
Ry4an Brase On

I upvoted kelloti's answer as this is just an expansion of it, but just used tiers of repositories. Have people push their un-reviewed changesets to a needs-review central-ish repository, and have reviewers push reviewed works from there to the needs-QA central-ish repository and have QA people push the release candidate central-ish repositories.

With a distributed version control system you can do a plurality of centralized repos as easily as you can do a plurality of developer repositories.