[PATCH 1 of 5] revlog: make commonancestorsheads accept revision numbers

Jun Wu quark at fb.com
Tue Nov 1 22:25:21 EDT 2016


Excerpts from Pierre-Yves David's message of 2016-11-02 00:05:32 +0100:
> I think I would rather see a two methods, one for revs and one for nodes 
> that would keep the signature of each function clearer. One of the 
> function would probably all into the other one to keep the code common.
> 
> What do you think?

If we have two "commonancestorsheads"s, we will have to write two
"isancestor"s. I'd avoid the contagious pattern that enforces the caller
("isancestor" in this case) to do things otherwise unnecessary.

Given the fact that "repo.rev(x)" takes both node and rev. And repo[x] takes
everything. I'd prefer shorter code. It can be seen as a reasonable function
overloading in C++.


More information about the Mercurial-devel mailing list