Possible problem with -f option to rename

Peter Williams pwil3058 at bigpond.net.au
Wed Mar 28 20:05:40 CDT 2007


During testing of my revision control GUI wrapper using hg as a back end 
I've noticed an anomaly when the -f option is used with rename to force 
the overwriting of an existing file.

For a normal invocation of rename, the moved file (in its new location) 
is marked as added ("A") by the status command and the -C option to the 
status command indicates the identity of the moved file but neither of 
these happen for a file that was overwritten with -f.  This anomaly 
occurs both when the actual contents of the overwritten file is the same 
after the overwrite and when it has changed after overwrite although in 
this latter case it is marked as modified ("M").

In all cases, the original file is marked as removed ("R").

I can see a case for the added ("A") mark not being used (i.e. the file 
already existed) but think some information is lost (from the user's 
point of view) by the failure of the -C option to indicate the origin 
(especially in the case where the contents of the target have changed as 
a result of the overwrite).

Is this the intended behaviour?

Thanks
Peter
-- 
Peter Williams                                   pwil3058 at bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce


More information about the Mercurial-devel mailing list