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

Submitted by:  Thomas Keller <tommyd>
Submitted on:  Fri 21 May 2010 12:29:07 AM UTC  
 
Category: working copySeverity: 3 - Normal
Item Group: incorrect behaviorStatus: Fixed
Privacy: PublicAssigned to: Thomas Keller <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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 21 May 2010 10:45:01 AM UTCtommydStatusNone=>Fixed
      Assigned toNone=>tommyd
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1