Comment 3 for bug 1040276

Revision history for this message
Paul Pelzl (pelzlpj) wrote : Re: [Bug 1040276] Re: "orphan_policy=move" does not preserve directory structure of orphaned files

On Thu, Sep 13, 2012 at 3:12 AM, Vincent Ladeuil <<email address hidden>
> wrote:

> > just unversion the directory and be done with it.
>
> If you leave the unversioned directory in place and do the opposite
> operation that led to the directory being unversioned, you'll get a
> conflict when trying to restore the versioned directory which will move
> that directory to <directory.moved> to be able to install the versioned
> one.
>

Yes, I think "doing the right thing" requires two distinct components:

    1) when a tree transform wants to remove a directory which contains
       versioned files, just unversion the directory with no conflicts
    2) when a tree transform wants to create a new directory in a
       location which already contains an unversioned directory,
       treat it as a no-op.

git demonstrates the desired observable behavior when switching
between branches. (Obviously it's a little different under the covers
since git doesn't track directories at all.) You don't get a conflict
unless versioned file contents differ.

Differentiating between junk and precious files is nice to have, but I
don't think it's as good as "doing the right thing" automatically.