#65: failure to rename back from -TAILOR-HACKED-TEMP-NAME
---------------------+------------------------------------------------------
  Reporter:  dato    |       Owner:  lele      
      Type:  defect  |      Status:  new       
  Priority:  major   |   Milestone:  VersionOne
 Component:  tailor  |     Version:  0.9       
Resolution:          |    Keywords:            
---------------------+------------------------------------------------------
Comment (by jamessan):

 I spent this weekend looking at the problem since I was trying to convert
 a darcs repo to svn which included a changeset that moved a directory.
 The fix to this should be pushed into the repository-specific parts of the
 code since each target repo will need to adjust things differently.  The
 diff below shows the changes I made to _renameEntries in target.py as a
 quick hack to get my import to work. (I would've attached the patch but
 that made the webserver cry -- 500 Internal Server Error.)

 {{{
 Mon Apr 23 18:10:20 EDT 2007  James Vega <[EMAIL PROTECTED]>
   * Quick hack for allowing conversions to svn which involve moving
 directories.
   This bit of code really needs to be handled by repository-specific code.
 This
   is just a quick proof-of-concept for how one can fix ticket #65 when the
 target
   repo is svn.
 diff -rN -u old-tailor/vcpx/target.py new-tailor/vcpx/target.py
 --- old-tailor/vcpx/target.py   2007-04-23 18:46:59.000000000 -0400
 +++ new-tailor/vcpx/target.py   2007-04-23 18:46:59.000000000 -0400
 @@ -430,7 +430,8 @@
          """

          from os import rename
 -        from os.path import split, join, exists
 +        from os.path import split, join, exists, isdir
 +        from shutil import rmtree, copytree

          added = []
          for e in entries:
 @@ -477,6 +478,9 @@
                      if self.shared_basedirs:
                          rename(absold + '-TAILOR-HACKED-TEMP-NAME',
 absold)
                      else:
 +                        if isdir(absnew):
 +                            copytree(join(absnew, '.svn'), join(absnew +
 '-TAILOR-HACKED-TEMP-NAME', '.svn'))
 +                            rmtree(absnew)
                          rename(absnew + '-TAILOR-HACKED-TEMP-NAME',
 absnew)

      def _renamePathname(self, oldname, newname):
 }}}

 We have to remove absnew in order for the rename to work, but first we
 need to make sure the new directory has the .svn directory so svn will see
 it as part of the controlled source tree.

-- 
Ticket URL: <http://progetti.arstecnica.it/tailor/ticket/65#comment:6>
Tailor <http://progetti.arstecnica.it/tailor>
An inter-VCs changeset exchanger
_______________________________________________
Tailor mailing list
[email protected]
http://lists.zooko.com/mailman/listinfo/tailor

Reply via email to