monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] Re: Undo a commit


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

Selon Daniel Carrera <address@hidden>:
> Daniel Carrera wrote:
>> So I am clear, the entire command is "mtn db_kill_rev_locally" and 
>> that's it? If we convinced the devs to make "mtn uncommit" an alias to

>> "mtn db_kill_rev_locally" would that cover my use case?
> 
> I just tried this on a sandbox branch and it doesn't work that well. In
> 
> particular, it fails if there are any uncommitted changes:
> 
> % mtn status
> Current branch: foo.sandbox.branch
> Changes against parent dcfbf59823cf21e292b60ba8f8463f65ea383597
>    added    foo
> 
> % mtn db kill_rev_locally dcfbf59823cf21e292b60ba8f8463f65ea383597
> mtn: misuse:
> Cannot kill revision dcfbf59823cf21e292b60ba8f8463f65ea383597, because
> 
> it would leave the current workspace in an invalid state, from which 
> monotone cannot recover automatically since the workspace contains 
> uncommitted changes. Consider updating your workspace to another 
> revision first, before you try to kill this revision again.
> 
> 
> 
> This is not good. Suppose I have edited files Foo1, Foo2 and Bar. I run
> 
> "mtn commit Foo1" because I forgot about Foo2. So I decide I want to 
> undo that last commit so I can run "mtn commit Foo1 Foo2" which is what
> 
> I wanted initially. Monotone won't let me do it because file Bar has 
> changes.

That's where my trick comes in: manually edit _MTN/revision without
changing anything else in your workspace, then kill the head revision.

-- 
Ludovic Brenta.




reply via email to

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