Proper tracking of file-level operations: rename, directories, merges

Martin Geisler mg at lazybytes.net
Tue Oct 25 09:28:23 UTC 2011


Liam Routt <liam.routt at mediasaints.com> writes:

> Caveat: I have not been following this discussion closely.
>
> On 25/10/2011 1:09 AM, Martin Geisler wrote:
>> I've asked you many times, but you have failed to demonstrate why it
>> is important to maintain the distinction. Please don't ignore this --
>> show a situation where Mercurial fails to merge the same nice way as
>> Bazaar does because Mercurial "only" has a copy+delete to work with.
>
> How do the two VCS handle situations where you attempt to rename a
> directory which has some contents which are not in version control.
>
> I *assume* that bzr would rename the directory, effectively moving the
> non-VC files in the process.

I just tested and it does move them.

> I *assume* (but have very little experience with Mercurial) that
> Mercurial would either create a new directory and copy only the VC
> files into it. Or would delete the old directory and create a new one
> with the files it knows about.

Uh, this is very interesting... Great example! If Alice does

  $ hg rename foo/ bar/

then an unknown file "foo/unknown" is left in place. Alice now has two
directories in her working copy, which is unfortunate.

However, if Bob pulls from Alice and merges, then the merge logic will
detect the directory rename and now "foo/unknown" is renamed to
"bar/unknown".

> Assuming I'm right about those behaviors (and I don't know that), I'd
> want the bzr behavior on my projects (even if Hg didn't delete a
> non-empty directory, which I suspect is the case). Hg might be right
> for the files under version control, but my work environment and those
> of my team members often includes other files which are not being
> tracked by the VCS for various reasons.

I see what you mean and I also think the behavior for known and unknown
files should be the same. Thanks for coming up with this example which I
could turn into

  http://mercurial.selenic.com/bts/issue3072

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20111025/e991c7fe/attachment.pgp>


More information about the bazaar mailing list