0.9.5 : bug when moving directory then creating file or symlink

Gaunet Sylvain sylvain.gaunet at astek.cnes.fr
Tue May 6 13:21:51 UTC 2008


I would like to re open the bug 660 like I said in many mails few days ago.

This is a bug like :

sylvain at ubuntu:~$ hg version
Mercurial Distributed SCM (version 1.0)

Copyright (C) 2005-2008 Matt Mackall <mpm at selenic.com> and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
sylvain at ubuntu:~$ mkdir tmp2 
sylvain at ubuntu:~$ cd tmp2 
sylvain at ubuntu:~/tmp2$ hg init 
sylvain at ubuntu:~/tmp2$ mkdir toto 
sylvain at ubuntu:~/tmp2$ touch toto/a 
sylvain at ubuntu:~/tmp2$ hg commit -A -m "1.0" 
adding toto/a 
sylvain at ubuntu:~/tmp2$ hg tag 1.0 
sylvain at ubuntu:~/tmp2$ mv toto/ tata 
sylvain at ubuntu:~/tmp2$ ln -s tata/ toto 
sylvain at ubuntu:~/tmp2$ ll 
total 4 
drwxr-xr-x 2 sylvain sylvain 4096 2008-04-23 13:00 tata
lrwxrwxrwx 1 sylvain sylvain    5 2008-04-23 13:00 toto -> tata/
sylvain at ubuntu:~/tmp2$ hg commit -A -m"2.0"
adding tata/a
adding toto
abort: directory 'toto' already in dirstate


Okay, I could use the hg mv but this is not also simple ... I receive the sources of software and I have to put in the scm, that's all. I don't want to know if a folder has been replace by a symlink or not.

Sylvain


-----Message d'origine-----
De : mercurial-bounces at selenic.com [mailto:mercurial-bounces at selenic.com] De la part de Patrick Mézard
Envoyé : mardi 6 mai 2008 13:49
À : Paul R
Cc : mercurial at selenic.com
Objet : Re: 0.9.5 : bug when moving directory then creating file or symlink


Paul R a écrit :
> Hi,
> 
> there seems to be a bug with pulling (and merging) from a repository 
> that performed the following operation since last fetch from it :  1. 
> Moved a directory 'oldDirPlace' to 'newDirPlace', or removed
>     'oldDirPlace'
>  2. Created a file or a symlink whose name is 'oldDirPlace'
> 
> To reproduce, follow those steps :
>  - create a repository "up" and clone it to "down"
>  - cd up
>  - mkdir foodir; touch foodir/foofile; hg add foodir/foofile
>  - hg commit -m "add foodir dir"
>  - cd ../down
>  - hg fetch
>  - cd ../up
>  - hg rm foodir; hg commit -m "rm foodir dir"
>  - touch foodir (or ln -s whatever foodir)
>  - hg add foodir; hg commit -m "add foodir file or symlink"
>  - cd ../down
>  - hg fetch

This bug is related to "update" and is fixed in 1.0. Here the other version I understood on IRC, closer to what is described above: move a directory then replace it with a file, in another branch change a directory file, merge. Run with crew it gives:

"""
$ hg init t
$ cd t
$ mkdir foo
$ echo a > foo/a
$ hg ci -Am create
adding foo/a
$ hg mv foo bar
moving foo/a to bar/a
$ echo a > foo
$ hg ci -Am move
adding foo
$ hg up -C 0
1 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo b >> foo/a $ hg ci -m change created new head $ hg merge --debug resolving manifests  overwrite None partial False  ancestor b485793ff0a4 local 32887cc33e7f+ remote 2c1f7e91b9e0
  searching for copies back to rev 1
  unmatched files in other:
   bar/a
   foo
  all copies found (* = to merge, ! = divergent):
   bar/a -> foo/a *
  checking for directory renames
  dir foo/ -> bar/
 foo/a: remote moved to bar/a -> m
 foo: remote created -> g
preserving foo/a for resolve of bar/a
removing foo/a
getting foo
abort: Is a directory: /Users/pmezard/dev/dismoiou/trunk/Client/player/t/foo
"""

I don't really know what to expect. A theory may be the merge tool should handle that, but AFAIK, the merge tool is not called here (but might a configuration issue).

--
Patrick Mézard
_______________________________________________
Mercurial mailing list
Mercurial at selenic.com http://selenic.com/mailman/listinfo/mercurial




More information about the Mercurial mailing list