Mercurial > hg
comparison hgext/rebase.py @ 16866:91f3ac205816
revlog: ancestors(*revs) becomes ancestors(revs) (API)
Accepting a variable number of arguments as the old API did is
deeply ugly, particularly as it means the API can't be extended
with new arguments. Partly as a result, we have at least three
different implementations of the same ancestors algorithm (!?).
Most callers were forced to call ancestors(*somelist), adding to
both inefficiency and ugliness.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 01 Jun 2012 12:37:18 -0700 |
parents | 38caf405d010 |
children | 1093ad1e8903 |
comparison
equal
deleted
inserted
replaced
16865:a6543fdcf869 | 16866:91f3ac205816 |
---|---|
222 ui.status(_('nothing to rebase\n')) | 222 ui.status(_('nothing to rebase\n')) |
223 return 1 | 223 return 1 |
224 else: | 224 else: |
225 originalwd, target, state = result | 225 originalwd, target, state = result |
226 if collapsef: | 226 if collapsef: |
227 targetancestors = set(repo.changelog.ancestors(target)) | 227 targetancestors = set(repo.changelog.ancestors([target])) |
228 targetancestors.add(target) | 228 targetancestors.add(target) |
229 external = checkexternal(repo, state, targetancestors) | 229 external = checkexternal(repo, state, targetancestors) |
230 | 230 |
231 if keepbranchesf: | 231 if keepbranchesf: |
232 assert not extrafn, 'cannot use both keepbranches and extrafn' | 232 assert not extrafn, 'cannot use both keepbranches and extrafn' |
241 'branches')) | 241 'branches')) |
242 | 242 |
243 | 243 |
244 # Rebase | 244 # Rebase |
245 if not targetancestors: | 245 if not targetancestors: |
246 targetancestors = set(repo.changelog.ancestors(target)) | 246 targetancestors = set(repo.changelog.ancestors([target])) |
247 targetancestors.add(target) | 247 targetancestors.add(target) |
248 | 248 |
249 # Keep track of the current bookmarks in order to reset them later | 249 # Keep track of the current bookmarks in order to reset them later |
250 currentbookmarks = repo._bookmarks.copy() | 250 currentbookmarks = repo._bookmarks.copy() |
251 | 251 |