monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Execute by default?


From: Markus Schiltknecht
Subject: Re: [Monotone-devel] Execute by default?
Date: Fri, 16 Feb 2007 12:54:06 +0100
User-agent: Icedove 1.5.0.9 (X11/20061220)

Hi,

Nathaniel Smith wrote:
It seems like always "executing" is the Right Thing for
add/drop/rename/pivot_root/whatever-else-I'm-forgetting.

Please also note, that not only 'drop' has a special case, but also 'add' in case the file doesn't exist. Monotone already refuses to add a non existing file.

IMO, it would be consistent if we did the third option (remove if unchanged, drop from repository (forget) if changed, perhaps with a warning) by default.

However, besides that default, I would like to still provide a '--no-execute' or '--change-tracking-only' or however-we-name-it option, which would simply do the change in monotone's tracking, i.e. allow you to add a non existing file or drop one without removing it.

Renaming even has two special cases: a) source does not exist and target already exists. However, these are very similar and should be treated likewise, IMO. (That is: by default execute the rename in the workspace. In case the target file already exists in the workspace, check if it equals the file we want to move there. If so, accept that and remove the source. If not, refuse to move.)

Pivot_root already has an '--execute' option. To be consistent with the above, that should be on by default.

Trying the current behavior, I stumbled across this slightly strange thing:

 # mtn ls known
 fileA
 source_dir
 source_dir/fileB

 -- do the pivot root workspace changes by hand
 # mkdir target_dir
 # mv fileA target_dir
 # mv source_dir/fileB ./
 # rmdir source_dir

 -- invoke pivot_root with --execute erroneously set
 # mtn pivot_root -e source_dir target_dir
 mtn: misuse: rename source path 'source_dir' does not exist

 -- anyway, the operation succeeded:
 # mtn ls known
 fileB
 target_dir
 target_dir/fileA

(It's only the error message I'm complaining about... ;-) )

Regards

Markus





reply via email to

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