##// END OF EJS Templates
rebase: block collapse with keepbranches on multiple named branches (issue2112)...
Stefano Tortarolo -
r14897:b9daa5b7 stable
parent child Browse files
Show More
@@ -175,6 +175,14 b' def rebase(ui, repo, **opts):'
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:
@@ -442,3 +442,41 b' Rebase and collapse - B onto F:'
442 D
442 D
443 F
443 F
444
444
445 Interactions between collapse and keepbranches
446 $ cd ..
447 $ hg init e
448 $ cd e
449 $ echo 'a' > a
450 $ hg ci -Am 'A'
451 adding a
452
453 $ hg branch '1'
454 marked working directory as branch 1
455 $ echo 'b' > b
456 $ hg ci -Am 'B'
457 adding b
458
459 $ hg branch '2'
460 marked working directory as branch 2
461 $ echo 'c' > c
462 $ hg ci -Am 'C'
463 adding c
464
465 $ hg up -q 0
466 $ echo 'd' > d
467 $ hg ci -Am 'D'
468 adding d
469
470 $ hg tglog
471 @ 3: 'D'
472 |
473 | o 2: 'C' 2
474 | |
475 | o 1: 'B' 1
476 |/
477 o 0: 'A'
478
479 $ hg rebase --keepbranches --collapse -s 1 -d 3
480 abort: cannot collapse multiple named branches
481 [255]
482
General Comments 0
You need to be logged in to leave comments. Login now