[PATCH 2 of 3 V3 part 1] transplant: replace incancestors uses with ancestors
Kevin Bullock
kbullock+mercurial at ringworld.org
Mon Dec 17 21:59:04 CST 2012
On 17 Dec 2012, at 5:19 PM, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0 at fb.com>
> # Date 1355785686 28800
> # Node ID edac5d9c4d2e12e3fe66fb8d60a58a2f1a966bef
> # Parent cc32dcb345b6e9d0f2b85bdd63e8262d7e12ac2a
> transplant: replace incancestors uses with ancestors
>
> diff -r cc32dcb345b6 -r edac5d9c4d2e hgext/transplant.py
> --- a/hgext/transplant.py Mon Dec 17 15:13:51 2012 -0800
> +++ b/hgext/transplant.py Mon Dec 17 15:08:06 2012 -0800
> @@ -94,7 +94,7 @@
> parentrev = repo.changelog.rev(parent)
> if hasnode(repo, node):
> rev = repo.changelog.rev(node)
> - reachable = repo.changelog.incancestors([parentrev], rev)
> + reachable = repo.changelog.ancestors([parentrev], rev, True)
I'd rather see us using the keyword arg explicitly, so we know what Truth we're referring to.
> if rev in reachable:
> return True
> for t in self.transplants.get(node):
> @@ -103,7 +103,8 @@
> self.transplants.remove(t)
> return False
> lnoderev = repo.changelog.rev(t.lnode)
> - if lnoderev in repo.changelog.incancestors([parentrev], lnoderev):
> + if lnoderev in repo.changelog.ancestors([parentrev], lnoderev,
> + True):
Here too.
pacem in terris / мир / शान्ति / سَلاَم / 平和
Kevin R. Bullock
More information about the Mercurial-devel
mailing list