"bzr ignore" behavoir
Alexander Belchenko
bialix at ukr.net
Fri Dec 9 19:17:07 UTC 2011
John Meinel пишет:
> http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/view/head:/bzrlib/globbing.py#L353
>
> On load we strip trailing slashes. Probably in ignore we do too.
OK.
>
> John
> =:->
>
> On Dec 9, 2011 4:44 PM, "Alexander Belchenko" <bialix at ukr.net
> <mailto:bialix at ukr.net>> wrote:
>
> John Arbash Meinel пишет:
>
> On 12/9/2011 3:33 PM, Alexander Belchenko wrote:
>
> I have a question: is there any difference for bzr between
> "./foo"
> and "./foo/" in the .bzrignore file?
>
> At least `bzr ignore` behaves strange IMHO:
>
> C:\Temp\2>bzr init Created a standalone tree (format: 1.14)
>
> C:\Temp\2>bzr ignore "./foo/"
>
> C:\Temp\2>bzr diff === added file '.bzrignore' --- .bzrignore
> 1970-01-01 00:00:00 +0000 +++ .bzrignore 2011-12-09 14:32:25
> +0000 @@ -0,0 +1,1 @@ +./foo
>
>
> Why has it been added to .bzrignore without trailing slash?
> Is it something win32-specific and related to custom
> command-line parsing
> code with glob expanding?
>
>
> I don't think it has to do with win32, I think the issue is that if
> you put "./foo/" it will fail to actually ignore the foo directory.
> Because when we check the path to ignore, the path we are comparing
> with is "./foo" which *doesn't* match ./foo/. So 'bzr ignore' strips
> the trailing slash to make sure we do what you are actually
> asking for.
>
> I could be wrong, but it is easy to check by manually editing
> the file.
>
>
> Well, according to my tests "./foo/" matches directory "foo":
>
> C:\Temp\2>bzr init
> Created a standalone tree (format: 1.14)
>
> C:\Temp\2>mkdir foo
>
> C:\Temp\2>bzr st
> unknown:
> foo/
>
> C:\Temp\2>echo ./foo/>.bzrignore
>
> C:\Temp\2>bzr st
> unknown:
> .bzrignore
>
> C:\Temp\2>bzr add
> adding .bzrignore
>
> C:\Temp\2>bzr diff
> === added file '.bzrignore'
> --- .bzrignore 1970-01-01 00:00:00 +0000
> +++ .bzrignore 2011-12-09 15:44:22 +0000
> @@ -0,0 +1,1 @@
> +./foo/
>
More information about the bazaar
mailing list