hgext/rebase.py
changeset 32175 456b4a32d75f
parent 32084 091d6b9157da
child 32248 b47e6b0ba6ca
equal deleted inserted replaced
32174:e4a4ebfd9d8e 32175:456b4a32d75f
  1244 
  1244 
  1245     roots = list(repo.set('roots(%ld)', rebaseset))
  1245     roots = list(repo.set('roots(%ld)', rebaseset))
  1246     if not roots:
  1246     if not roots:
  1247         raise error.Abort(_('no matching revisions'))
  1247         raise error.Abort(_('no matching revisions'))
  1248     roots.sort()
  1248     roots.sort()
  1249     state = {}
  1249     state = dict.fromkeys(rebaseset, revtodo)
  1250     detachset = set()
  1250     detachset = set()
  1251     for root in roots:
  1251     for root in roots:
  1252         commonbase = root.ancestor(dest)
  1252         commonbase = root.ancestor(dest)
  1253         if commonbase == root:
  1253         if commonbase == root:
  1254             raise error.Abort(_('source is ancestor of destination'))
  1254             raise error.Abort(_('source is ancestor of destination'))
  1262             if not collapse and samebranch and root in dest.children():
  1262             if not collapse and samebranch and root in dest.children():
  1263                 repo.ui.debug('source is a child of destination\n')
  1263                 repo.ui.debug('source is a child of destination\n')
  1264                 return None
  1264                 return None
  1265 
  1265 
  1266         repo.ui.debug('rebase onto %s starting from %s\n' % (dest, root))
  1266         repo.ui.debug('rebase onto %s starting from %s\n' % (dest, root))
  1267         state.update(dict.fromkeys(rebaseset, revtodo))
       
  1268         # Rebase tries to turn <dest> into a parent of <root> while
  1267         # Rebase tries to turn <dest> into a parent of <root> while
  1269         # preserving the number of parents of rebased changesets:
  1268         # preserving the number of parents of rebased changesets:
  1270         #
  1269         #
  1271         # - A changeset with a single parent will always be rebased as a
  1270         # - A changeset with a single parent will always be rebased as a
  1272         #   changeset with a single parent.
  1271         #   changeset with a single parent.