##// END OF EJS Templates
rebase: delete divergent bookmarks on destination (issue3685)...
Siddharth Agarwal -
r18514:2a1fac36 stable
parent child Browse files
Show More
@@ -316,7 +316,7 b' def rebase(ui, repo, **opts):'
316 clearrebased(ui, repo, state, skipped, collapsedas)
316 clearrebased(ui, repo, state, skipped, collapsedas)
317
317
318 if currentbookmarks:
318 if currentbookmarks:
319 updatebookmarks(repo, nstate, currentbookmarks, **opts)
319 updatebookmarks(repo, dest, nstate, currentbookmarks)
320
320
321 clearstatus(repo)
321 clearstatus(repo)
322 ui.note(_("rebase completed\n"))
322 ui.note(_("rebase completed\n"))
@@ -493,13 +493,15 b' def updatemq(repo, state, skipped, **opt'
493 mq.seriesdirty = True
493 mq.seriesdirty = True
494 mq.savedirty()
494 mq.savedirty()
495
495
496 def updatebookmarks(repo, nstate, originalbookmarks, **opts):
496 def updatebookmarks(repo, dest, nstate, originalbookmarks):
497 'Move bookmarks to their correct changesets'
497 'Move bookmarks to their correct changesets, and delete divergent ones'
498 destnode = dest.node()
498 marks = repo._bookmarks
499 marks = repo._bookmarks
499 for k, v in originalbookmarks.iteritems():
500 for k, v in originalbookmarks.iteritems():
500 if v in nstate:
501 if v in nstate:
501 # update the bookmarks for revs that have moved
502 # update the bookmarks for revs that have moved
502 marks[k] = nstate[v]
503 marks[k] = nstate[v]
504 bookmarks.deletedivergent(repo, [destnode], k)
503
505
504 marks.write()
506 marks.write()
505
507
@@ -56,17 +56,35 b' Move only rebased bookmarks'
56 $ cd a1
56 $ cd a1
57 $ hg up -q Z
57 $ hg up -q Z
58
58
59 Test deleting divergent bookmarks from dest (issue3685)
60
61 $ hg book -r 3 Z@diverge
62
63 ... and also test that bookmarks not on dest or not being moved aren't deleted
64
65 $ hg book -r 3 X@diverge
66 $ hg book -r 0 Y@diverge
67
68 $ hg tglog
69 o 3: 'D' bookmarks: W X@diverge Z@diverge
70 |
71 | @ 2: 'C' bookmarks: Y Z
72 | |
73 | o 1: 'B' bookmarks: X
74 |/
75 o 0: 'A' bookmarks: Y@diverge
76
59 $ hg rebase -s Y -d 3
77 $ hg rebase -s Y -d 3
60 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
78 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
61
79
62 $ hg tglog
80 $ hg tglog
63 @ 3: 'C' bookmarks: Y Z
81 @ 3: 'C' bookmarks: Y Z
64 |
82 |
65 o 2: 'D' bookmarks: W
83 o 2: 'D' bookmarks: W X@diverge
66 |
84 |
67 | o 1: 'B' bookmarks: X
85 | o 1: 'B' bookmarks: X
68 |/
86 |/
69 o 0: 'A' bookmarks:
87 o 0: 'A' bookmarks: Y@diverge
70
88
71 Keep bookmarks to the correct rebased changeset
89 Keep bookmarks to the correct rebased changeset
72
90
General Comments 0
You need to be logged in to leave comments. Login now