Another MSYS puzzle

Adrian Buehlmann adrian at cadifra.com
Sun Jun 10 19:12:18 CDT 2012


On 2012-06-11 02:01, Adrian Buehlmann wrote:
> On 2012-06-11 01:34, Adrian Buehlmann wrote:
>> On 2012-06-11 01:11, timeless wrote:
>>> Adrian wrote:
>>>>  $ hg debugwalk -I 'relpath:../beans'
>>>> Answer:
>>>> The value of the include option we get is: 'relpath;..\beans' (!)
>>>
>>>> Wanted: Idea how to handle this.
>>>
>>> Support this:
>>> hg debugwalk -I ';relpath:../beans'
>>>
>>> I believe it satisfies the requirements [1].
>>>
>>> [1] http://www.mingw.org/wiki/Posix_path_conversion
>>
>> Thanks.
>>
>> Testing with MSYS reveals: Yes, that would work. The argument is passed
>> as is to Mercurial.
>>
>> Open question is, whether we are allowed to patch Mercurial accordingly.
> 
> Variants that would also let MSYS not modify the argument (all tested):
> 
>  (1) 'relpath;:../beans'
>  (2) 'relpath;../beans'
>  (3) 'relpath:;../beans'
>  (4) 'relpath:../beans;'
> 
> It seems the ';' can be anywhere.
> 
> So we could create for example a directory with the name "beans;" or
> "bea;ns" or ";beans". These are all valid names for files and
> directories on Windows.
> 
> http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx

This passes inside a *.t file (still requires ui.slash debugwalk patch):

  $ hg init t
  $ cd t
  $ mkdir -p "bea;ns"
  $ for b in kidney navy turtle borlotti black pinto; do
  >     echo $b > "bea;ns"/$b
  $ done
  $ hg addremove
  adding bea;ns/black
  adding bea;ns/borlotti
  adding bea;ns/kidney
  adding bea;ns/navy
  adding bea;ns/pinto
  adding bea;ns/turtle
  $ hg commit -m "commit #0"

  $ mkdir mammals
  $ cd mammals
  $ hg debugwalk -I 'relpath:../bea;ns'
  f  bea;ns/black     ../bea;ns/black
  f  bea;ns/borlotti  ../bea;ns/borlotti
  f  bea;ns/kidney    ../bea;ns/kidney
  f  bea;ns/navy      ../bea;ns/navy
  f  bea;ns/pinto     ../bea;ns/pinto
  f  bea;ns/turtle    ../bea;ns/turtle


More information about the Mercurial-devel mailing list