Mercurial > hg
comparison hgext/rebase.py @ 14897:b9daa5b7a3af stable
rebase: block collapse with keepbranches on multiple named branches (issue2112)
Collapse and keepbranches should be blocked when there is more than
one named branch on the branch that's going to be rebased.
author | Stefano Tortarolo <stefano.tortarolo@gmail.com> |
---|---|
date | Mon, 18 Jul 2011 22:58:21 +0200 |
parents | c0ccd70df52c |
children | 2957b8b1e809 |
comparison
equal
deleted
inserted
replaced
14892:d2d592718e90 | 14897:b9daa5b7a3af |
---|---|
173 | 173 |
174 if keepbranchesf: | 174 if keepbranchesf: |
175 assert not extrafn, 'cannot use both keepbranches and extrafn' | 175 assert not extrafn, 'cannot use both keepbranches and extrafn' |
176 def extrafn(ctx, extra): | 176 def extrafn(ctx, extra): |
177 extra['branch'] = ctx.branch() | 177 extra['branch'] = ctx.branch() |
178 if collapsef: | |
179 branches = set() | |
180 for rev in state: | |
181 branches.add(repo[rev].branch()) | |
182 if len(branches) > 1: | |
183 raise util.Abort(_('cannot collapse multiple named ' | |
184 'branches')) | |
185 | |
178 | 186 |
179 # Rebase | 187 # Rebase |
180 if not targetancestors: | 188 if not targetancestors: |
181 targetancestors = set(repo.changelog.ancestors(target)) | 189 targetancestors = set(repo.changelog.ancestors(target)) |
182 targetancestors.add(target) | 190 targetancestors.add(target) |