bugmonotone - Bugs: bug #29927, mtn clone removes existing...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #29927: mtn clone removes existing bookkeeping directory on failure

Submitter:  Thomas Keller <tommyd>
Submitted:  Fri 21 May 2010 12:29:07 AM UTC
   
 
Category:  working copy Severity:  3 - Normal
Item Group:  incorrect behavior Status:  Fixed
Privacy:  Public Assigned to:  tommyd
Open/Closed:  Closed
mtn version --full: 

0.47 and before

Fri 21 May 2010 10:45:01 AM UTC, comment #1: 

The bug has been fixed in 86ecfdd528efce61435b22c9778f3366ca6b26c4 - we still should unify the target dir handling for both commands IMHO.

Thomas Keller <tommyd>
Group administrator
Fri 21 May 2010 12:29:07 AM UTC, original submission:  

mtn clone allows to be executed in ".". When this directory contains a monotone bookkeeping directory, the cloning is aborted, but the original _MTN directory is also removed!

Here is why:

In case of a failure we want to clean up newly created files and directories afterwards. We do this by using a directory cleanup helper which acts upon destruction: it removes the complete directory if it did not exist previously or alternatively only the _MTN directory for an existing directory. And the last thing is the problem:
The helper is created before the workspace is attempted to be created, the workspace now cannot be created because of an already existing _MTN directory and the helper removes this directory as it has been told to do so.

Because of the code sharing and some new functionality this bug also affects the setup command in the upcoming version 0.48. I can think of two ways to fix this bug:

a) check for an existing bookkeeping directory separately before the cleanup helper is created

b) don't allow setup / clone to be called for an existing directory

(I tend to a))

On a related note - clone uses the branch name as directory name for the clone if no directory has been given explicitely while setup defaults to the current directory (".") - do we want to unify these? I'd propose that both fall back to the branch name as directory name.

Thomas Keller <tommyd>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tommyd (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-05-21 tommyd StatusNone Fixed
        Assigned toNone tommyd
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code