On Fri, 27 Mar 2009 23:45:13 +0100 (CET)
[email protected] wrote:

> Fri Mar 27 23:40:12 CET 2009  [email protected]
>   * bzr-prevent-PathsNotVersionedError
>   This prevents a PathsNotVersionedError exception when using cvs =>
> bzr and it tries to remove files which had been removed in the
> previous commit already. I have the full log available - which you
> probably want to see. I think this should get catched/handled not in
> the target implementation, but more central - but I have not enough
> knowledge of the tailor source and this works for my case.
> 
> hunk ./vcpx/repository/bzr.py 393
>          if entries:
>              entries = [normpath(entry) for entry in entries]
>  
> +        # Filter out unversioned files (to prevent PathsNotVersionedError)
> +        if entries:
> +            self._working_tree.lock_write()
> +            try:
> +                entries = [name for name in entries if name not in 
> self._working_tree.filter_unversioned_files(entries)]
> +            finally:
> +                self._working_tree.unlock()
> +
>          self._working_tree.commit(logmessage, committer=author,
>                                    specific_files=entries,
>                                    
> verbose=self.repository.projectref().verbose,

This seems wrong to me, but OTOH I haven't checked
filter_unversioned_files() so I'm not sure: in the way it's written,
that function gets called once for each name in entries, passing it
the same (unchanged!) list every time.

Could you please check if the following works?

hunk ./vcpx/repository/bzr.py 393
         if entries:
             entries = [normpath(entry) for entry in entries]
 
+            # Filter out unversioned files (to prevent PathsNotVersionedError)
+            self._working_tree.lock_write()
+            try:
+                unversioned = 
self._working_tree.filter_unversioned_files(entries)
+            finally:
+                self._working_tree.unlock()
+            entries = [name for name in entries if name not in unversioned]
+
         self._working_tree.commit(logmessage, committer=author,
                                   specific_files=entries,
                                   verbose=self.repository.projectref().verbose,

Also, does it really need to be a write lock?

thank you,
ciao, lele.
-- 
nickname: Lele Gaifax    | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas    | comincerò ad aver paura di chi mi copia.
[email protected] |                 -- Fortunato Depero, 1929.
_______________________________________________
Tailor mailing list
[email protected]
http://lists.zooko.com/mailman/listinfo/tailor

Reply via email to