File Introduced as Both a Largefile and Regular File?

Na'Tosha Bard natosha at unity3d.com
Fri Nov 4 09:15:15 CDT 2011


OK, so after some more investigation into this issue, I propose that we
solve the problem like this:

Check for conflicting largefiles vs. regular files in both heads before
attempting to merge.  Abort the merge if such a conflict is found,
explaining to the user that they need to modify one of the heads to fix the
conflict before continuing the merge.

Does this seem reasonable?

Another possibility would be to provide a "pick local or other" question in
this instance.

Cheers,
Na'Tosha

2011/11/3 Na'Tosha Bard <natosha at unity3d.com>

> Hello,
>
> We ran into a very interesting bug here and I'm not sure what the proper
> fix should be.  Test case:
>
> $ hg init foo
> $ cd foo/
> $ echo "n1" > n1
> $ hg add
> adding n1
> $ hg commit -m "Add as normal file"
> $ echo "b1" > b1
> $ hg add --large b1
> $ hg commit -m "Add as largefile"
> $ hg update -r 0
> 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
> getting changed largefiles
> 0 largefiles updated, 1 removed
> $ echo "b2" > b1
> $ hg add
> adding b1
> $ hg commit -m "Add as normal file"
> created new head
> $ hg merge
> 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> (branch merge, don't forget to commit)
> getting changed largefiles
> 1 largefiles updated, 0 removed
> $ hg commit -m "Merge two heads"
>
> Now we have "b1" in the history, both as a regular file AND as a
> largefile.  Of course this happens because Mercurial is tracking the
> standin, and not the actual largefile, but *logically* they should be the
> same file.
>
> Also, if I make a clone of foo, b1 is immediately modified according to
> "status":
>
> $ hg clone foo bar
> updating to branch default
> 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> getting changed largefiles
> 0 largefiles updated, 0 removed
> $ cd bar
> $ hg status
> M b1
>
> What should we do in this case?  Should we look for a name collision
> between the files the standins represent and and regular files on the two
> sides of the merge and abort the merge?
>
> Cheers,
> Na'Tosha
>
> --
> *Na'Tosha Bard*
> Build & Infrastructure Developer | Unity Technologies
>
> *E-Mail:* natosha at unity3d.com
> *Skype:* natosha.bard
>
>


-- 
*Na'Tosha Bard*
Build & Infrastructure Developer | Unity Technologies

*E-Mail:* natosha at unity3d.com
*Skype:* natosha.bard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111104/a4495b14/attachment.html>


More information about the Mercurial-devel mailing list