Mercurial > public > mercurial-scm > hg-stable
diff hgext/rebase.py @ 18093:9c76da468a19
rebase: use lazy ancestor membership testing
For a repository with over 400,000 commits, rebasing one revision near tip,
this avoids one walk up the DAG, speeding the operation up by around 0.8
seconds.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Mon, 17 Dec 2012 20:51:21 -0800 |
parents | e8c9b13c7799 |
children | bacf55bd8f90 |
line wrap: on
line diff
--- a/hgext/rebase.py Mon Dec 17 20:43:37 2012 -0800 +++ b/hgext/rebase.py Mon Dec 17 20:51:21 2012 -0800 @@ -214,8 +214,8 @@ else: originalwd, target, state = result if collapsef: - targetancestors = set(repo.changelog.ancestors([target])) - targetancestors.add(target) + targetancestors = repo.changelog.ancestors([target], + inclusive=True) external = checkexternal(repo, state, targetancestors) if keepbranchesf: @@ -233,8 +233,7 @@ # Rebase if not targetancestors: - targetancestors = set(repo.changelog.ancestors([target])) - targetancestors.add(target) + targetancestors = repo.changelog.ancestors([target], inclusive=True) # Keep track of the current bookmarks in order to reset them later currentbookmarks = repo._bookmarks.copy()