monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] bug#13604: undrop


From: Stephen Leake
Subject: [Monotone-devel] bug#13604: undrop
Date: Mon, 10 May 2010 07:53:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (windows-nt)

'undrop' is a new command; see nvm.bugfest-2010.13604-stephen_leake

The purpose of 'undrop' is to revoke a mistaken 'drop', before it is
committed.

There is an issue about how to deal with the '--recursive' option.

Currently, 'nodrop' allows '--recursive', but ignores it. That's so a
user can do:

drop --recursive dir
(oops, discover mistake)
undrop --recursive dir

But undrop actually ignores the '--recursive' option.

The question then is:

    Suppose the user wanted to drop dir/*, but not dir?

    'undrop' (without --recursive) should restore just dir, but not dir/*

I think the best thing to do here is disallow --recursive on undrop, and
in effect assume --recursive for 'undrop dir'.

Note that 'drop dir' without '--recursive' gives an error:

mtn: misuse: cannot remove dir1/, it is not empty

So it makes sense for 'undrop dir' to assume '--recursive' was given on
'drop'.

Then the use case above would be:

    drop --recursive dir
    (realize mistake)
    undrop dir
    drop [--recursive] dir/*

I think that's fair; first undo the mistake, then do the right thing.
Trying to support "partial undo" could lead to a can of worms:

    drop --recursive dir1
    (realize mistake)
    undrop dir1/file1

What would that do?

Currently, this gives an error:
 mtn: warning: restriction excludes addition of 'dir1' but includes addition of 
'dir1/file1'
mtn: misuse: invalid restriction


opinions?

-- 
-- Stephe




reply via email to

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