<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Thx for sharing your plugin benoit.<div>I 'rewrite the history' doing it by hand ... just to fully understand what I've done.</div><div>I will test your plugin to see the difference.</div><div>Thx again.</div><div><br><br><div>> Date: Thu, 19 Jun 2014 21:39:12 +0200<br>> Subject: Re: Undo a wrong merge with Bazaar<br>> From: benoit.pierre@gmail.com<br>> To: trident_job@hotmail.com<br>> CC: bazaar@lists.canonical.com<br>> <br>> On Thu, Jun 19, 2014 at 8:56 PM, TRIDENT JOB <trident_job@hotmail.com> wrote:<br>> > Hi BZR community !<br>> <br>> Hi,<br>> <br>> > I have an issue while using Bazaar and I would like to get the best<br>> > practices to fix it. Here is the context:<br>> ><br>> > In the trunk of our project, one wrongly merged a branch (BranchA) in the<br>> > trunk but he used revert on most files while keeping the merge info (so from<br>> > bazaar BranchA was effectively merged in trunk, preventing to REALLY merge<br>> > it later).<br>> > The merged revision was committed as r4.<br>> ><br>> > After this (undesired) merge, many devs committed right after (r5 & r6).<br>> ><br>> > So my question is : how to undo this wrong merge ? (while keeping the<br>> > commits after).<br>> ><br>> > I tried to uncommit back to r3 and merge each rev from r4 to R6 (omitting<br>> > r4)<br>> > I tried 'reverse cherry pick' r4 ... but the BranchA merge information may<br>> > still memorized.<br>> ><br>> > trunk<br>> > |<br>> > r6<br>> > |<br>> > r5<br>> > | branchA<br>> > | |<br>> > r4 ---+<br>> > | |<br>> > | r2.2<br>> > | |<br>> > r3 r2.1<br>> > | |<br>> > r2 ---+<br>> > |<br>> > r1<br>> ><br>> > If you have a solution or some clue to fix it, please share it !<br>> > (for example can REBASE command help here?)<br>> <br>> I fear rewriting history is really the only solution here, which of<br>> course mean that you must do it sooner rather than later since every<br>> developer will have to overwrite its copy of the old branch with the<br>> new one. If you are interested I have a personal plugin that I made<br>> and used to use intensively (I don't use Bazaar anymore) that can make<br>> it easier to interactively rewrite history (it's based on how "git<br>> rebase -i" work): you can get it here:<br>> https://code.launchpad.net/~benoit.pierre/+junk/bzr-rewrite_interactive<br>> <br>> With this plugin installed, you can (I assume you're using a<br>> lightweight checkout, starting from trunk):<br>> <br>> - make a backup copy: bzr branch . ../trunk.bak<br>> - go back to r3: bzr pull --overwrite -r 3 .<br>> - rewrite the missing history from backup: bzr rewrite ../trunk.bak<br>> <br>> You can either keep r4 if there are some changes to keep (merge info<br>> will be lost, so you will be able to merge branchA again), or just<br>> remove it by deleting the corresponding line.<br>> <br>> Cheers,<br>> <br>> -- <br>> A: Because it destroys the flow of conversation.<br>> Q: Why is top posting dumb?<br></div></div> </div></body>
</html>