monotone-devel
[Top][All Lists]
Advanced

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

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


From: Daniel Carrera
Subject: Re: [Monotone-devel] Re: Undo a commit
Date: Fri, 10 Oct 2008 01:30:39 +0200
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

Lapo Luchini wrote:
But using disapprove you actually did not "un-commit", you really wanted
a commit that had the previous state (again)... so if the previous one
had "add directory, add file", this one gets "delete file, delete
directory"... it's correct that way, because that's what the "new
revision" wants to do over the previous one...

I think the problem is you wanted to do an "un-commit" and that doesn't
really exist(except, with proper care, "db kill_rev_locally", which does
exactly that: even restores the workspace state in the same state it was
before the commit) and what you ended up doing is something really
different... it's a matter of expectations, IMHO, and not some inherent
"wrongness" in the "mtn update" behaviour.

I can see the argument about "mtn update". In general, "mtn update" means "change the files on this directory to match what is on the DB". So I don't blame "mtn update" for changing the files. I think that the problem is with "mtn disapprove" and the fact that after I ran mtn disapprove I could not run "mtn commit" again to get my changes committed the right way.

I'm not sure that I agree that the problem is that there is no un-commit with Monotone. I don't object to Monotone recording the fact that I made a wrong commit and decided to reverse it. I only object to not being able to do the correct commit later. This is how I was expecting "mtn disapprove" to work:

mtn commit

## Oops, I commited Foo and Bar but I only meant to commit Foo.

mtn disapprove  ## A commit that says "cancel the last commit".

mtn commit ## THIS time I get only Foo like I originally intended.


I think that this is sensible. "mtn disapprove" changes the DB to note the fact that I reversed the last commit and now I can make a new commit. In the database, the above would be recorded like this:

* daniel committed Foo an Bar
* daniel reversed the commit of Foo an dBar
* daniel committed Foo


In other words, I don't think "mtn update" did anything wrong, but I think that "mtn disapprove" did something wrong by forcing me to run "mtn update" for no obvious reason. I don't object to keeping a history showing that I committed something and then I changed my mind. And you could argue that this is better than altering the history. But I do object to losing my work because I a wrong commit cannot be reversed without running the destructive "mtn update".


Daniel.




reply via email to

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