[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Re: Undo a commit

From: Ludovic Brenta
Subject: Re: [Monotone-devel] Re: Undo a commit
Date: Fri, 10 Oct 2008 12:30:56 +0200
User-agent: Internet Messaging Program (IMP) 3.2.2

Selon Thomas Keller <address@hidden>:
> I'd do it "safely" without messing around with _MTN/revision and move
> the current changes aside to re-apply them later on:
> $ mtn diff > current_changes.txt
> $ mtn revert .
> $ mtn db kill_rev_locally dcfbf59823cf21e292b60ba8f8463f65ea383597
> $ patch -p0 < current_changes.txt

The problem with this "safe" approach is that it is unsafe in the presence
of new, moved or deleted files.

A new but uncommitted file will appear as a hunk in the diff, it will
survive the "mtn revert .", and applying the diff will double its

A moved file will actually not appear in the diff at all, except as a
comment; reapplying the diff will lose that change.

A deleted file may appear as a hunk in the diff (I'm not sure anymore; it
may also appear only as a comment) in which case reapplying the diff will
not delete the file, only make it empty.

> Of course we could teack kill_rev_locally also to accept workspace
> changes and essentially do a workspace merge for these cases, but I'm
> not sure if there is really a use case for this which is worth to mess
> with that.

Or teach db kill_rev_locally to only change the workspace's parent
revision without changing anything to the workspace?

Ludovic Brenta.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]