Failing WT case_sensitive test on Windows

Jelmer Vernooij jelmer at samba.org
Sun Jan 23 06:13:03 UTC 2011


On Sat, 2011-01-22 at 13:10 -0600, John Arbash Meinel wrote:
> I just realized why the WT2 case_sensitive test is failing. The test is
> done here:
> 
>     def _detect_case_handling(self):
>         wt_trans = self.bzrdir.get_workingtree_transport(None)
>         try:
>             wt_trans.stat("FoRMaT")
>         except errors.NoSuchFile:
>             self.case_sensitive = True
>         else:
>             self.case_sensitive = False
> 

> So it is checking for a "format" file in the WT control directory.
> However the all-in-one WT doesn't have a "format" file. It only has
> "branch-format".
Ahh! Thanks for looking at this.

>  Put another way, WT3&4 look at:
> 
>  .bzr/checkout/format
> 
> But WT2 only has
>  .bzr/branch-format
> 
> There isn't a .bzr/format file to look for.
> 
> The test passes on Linux, because it assumes that if the "FoRMaT" file
> can't be found, it is because it is miss capitalized, not because it is
> completely gone.
> 
> This fixes it, but I'm not 100% happy with it:
> 
> === modified file 'bzrlib/workingtree.py'
> - --- bzrlib/workingtree.py       2011-01-19 20:04:23 +0000
> +++ bzrlib/workingtree.py       2011-01-22 19:09:36 +0000
> @@ -2707,6 +2707,17 @@
>          if self._inventory is None:
>              self.read_working_inventory()
> 
> +    def _detect_case_handling(self):
> +        wt_trans = self.bzrdir.get_workingtree_transport(None)
> +        try:
> +            wt_trans.stat("Branch-FoRMaT")
> +        except errors.NoSuchFile:
> +            self.case_sensitive = True
> +        else:
> +            self.case_sensitive = False
> +
> +        self._setup_directory_is_tree_reference()
> +
>      def _get_check_refs(self):
>          """Return the references needed to perform a check of this tree."""
>          return [('trees', self.last_revision())]
Would it perhaps make sense to override _detect_case_handling for WT2 to
look at branch-format only then? That way the existing code can stay
sensible and we only have the hack to look at branch-format in WT2.

Cheers,

jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20110122/8be9234b/attachment.pgp>


More information about the bazaar mailing list