[darcs-users] tailor adding subdirectory before parent directory

Nathan Gray kolibrie at graystudios.org
Fri May 6 17:01:23 UTC 2005


On Fri, May 06, 2005 at 05:50:20PM +0200, Lele Gaifax wrote:
> >>>>> "Nathan" == Nathan Gray <kolibrie at graystudios.org> writes:
> 
>     Nathan> I ran into a problem while trying to sync an initial
>     Nathan> import patch from darcs into CVS.  It looks like the
>     Nathan> subdirectory 't' was added before the parent directory
>     Nathan> 'MAPI2Message', so the 'cvs add' failed:
> 
> Uhm, that should not happen, of course... See
> SyncronizableTargetWorkingDir._replayChangeset() in target.py: there
> is the code that sort the directories and add them before the files. I
> miss to understand your case...

I was adding a parent directory, with files and a subdirectory, and its
files.  It appears that tailor attempted to add the subdirectory before
adding the parent directory.  Then it attempted to add the files.
Looking at _replayChangeset, I see that directories are sorted one way
when being added:

  # Sort added dirs, to be sure that /root/addedDir/ comes before
  # /root/addedDir/addedSubdir
  addeddirs.sort(lambda x,y: cmp(y.name, x.name))

and the same way when being removed:

  # Sort removes in reverse order, to delete directories after
  # their entries.
  removed.sort(lambda x,y: cmp(y.name, x.name))

Should one of these sorts be reversed?

>     Nathan> How do I fix CVS, so that my 't' subdirectory and files
>     Nathan> are added?  I want for tailor to not be confused about the
>     Nathan> commit that did not come from itself.
> 
> Yes, that should work, but I'm not an expert in two-way setups :)

Adding and committing manually with CVS seems to have gotten tailor back
in sync.

>     Nathan> How does tailor specify the date, so that I can do that,
>     Nathan> too?
> 
> Uhm, that does not work, for CVS. Currently, only Darcs and Monotone
> lets you specify the date of the patch.

I see.  That does explain why I couldn't find the code in tailor, nor
documentation on the Internet.

-kolibrie




More information about the darcs-users mailing list