bzr.bat works badly on win98
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Unassigned |
Bug Description
affects /products/bzr
(See list thread from end of Feb 2006; suggested fix is below)
----- Forwarded message from Steve Christensen <email address hidden> -----
From: Steve Christensen <email address hidden>
Subject: Re: bzr.bat splaps all win98 users immediately in the face
Date: Mon, 27 Feb 2006 19:05:52 -0700
To: <email address hidden>
X-Spam-Status: No, score=-99.1 required=3.0 tests=BAYES_00,
FROM_CONSEC_
autolearn=no version=3.1.0
User-Agent: Mutt/1.5.9i
John Arbash Neinel wrote:
> James Blackwell wrote:
> > On Mon, Feb 27, 2006 at 03:08:38PM -0500, Robert J. Cristel wrote:
> >> C:\Python24\
> >> @C:\Python24\
> >>
> >> C:\Python24\
> >> bzr: ERROR: unknown command '*'
> >>
> >> C:\Python24\
> >>
> >> C:\Python24\
> >>
> >> Why?
> >>> Windows NT 4 introduced a set of new features for command line parameters:
> >>> %* will return all command line parameters following %0
> >
> >
> > I know that Windows 2000 has it. I'm unable to verify that NT4 has it. Bzr
> > is telling you though that it got "*" for an argument, which implies to me
> > that NT 4 doesn't have the feature. I suggest that you test with this
> > standalone batch script
> >
> > test.bat:
> > echo I got:%*
> >
> > C..> test.bat hello world
> >
> > The results may be illuminating. By the way, newer versions of bzr have
> > command aliases which may help you out of the problem that you're in.
> >
> > Regards,
> > James
> >
>
> Actually, the problem is that he is on Windows 98, which doesn't have
> anything from the NT line. So $* is illegal in win98.
>
> Now officially, we don't support Win9x platforms. I realize we shouldn't
> be overly hostile towards it, though.
>
> All he is really asking is that we change our default .bat file to be:
>
> "c:\Path\
>
> (I don't believe that the Win9x batch processor can handle more than 9
> arguments).
>
> It is a small change, and if it works for him, then we might as well do it.
>
> That said, if we run into any other major problems (like the fact that
> Win9x support for unicode is very poor, and bzr uses unicode
> extensively), I don't expect we will do a lot of work to make bzr run on
> Win98.
>
> Can you let us know if changing the batch file makes bzr work for you?
> Otherwise there isn't much point in adding the fix, as it then limits
> other windows people to only 9 arguments. (Which is probably sufficient
> in the common case, but still a limitation).
>
> Oh, and probably it needs to be:
>
> "$1" "$2" "$3"
>
> Can you confirm that as well? I know my colleague tried to do:
> bzr commit -m 'some text'
>
> But it turns out that the Windows XP shell doesn't treat single quotes
> as special.
>
> (Which brings up another point, that the message 'No changes to commit'
> hides the problem, and probably when a file spec is given we should give
> 'No changes to "foo" to commit')
You could also change the .bat file to do the right thing on
NT/XP/Vista, and the 'old' way on 98/95.
Here's what Vim's gvim.bat looks like. For 98/95, they loop over the
command-line w/ shift, accumulating the command-line parameters in
%VIMARGS%. But, on NT/XP/2005 it just uses %*
Or, look at Maven's mvn.bat:
http://
-------
@echo off
rem -- Run Vim --
set VIM=C:\Program Files\Vim
if exist "%VIM%\
echo "%VIM%\
goto eof
:havevim
rem collect the arguments in VIMARGS for Win95
set VIMARGS=
set VIMNOFORK=
:loopstart
if .%1==. goto loopend
if NOT .%1==.-f goto noforkarg
set VIMNOFORK=1
:noforkarg
set VIMARGS=%VIMARGS% %1
shift
goto loopstart
:loopend
if .%OS%==.Windows_NT goto ntaction
if .%VIMNOFORK%==.1 goto nofork
start "%VIM%\
goto eof
:nofork
start /w "%VIM%\
goto eof
:ntaction
rem for WinNT we can use %*
if .%VIMNOFORK%==.1 goto noforknt
start "dummy" /b "%VIM%\
goto eof
:noforknt
start "dummy" /b /wait "%VIM%\
:eof
set VIMARGS=
set VIMNOFORK=
----- End forwarded message -----
--
Martin
Yes. This was intended because bzr seems to not work well on Win98. So when I wrote bzr.bat generator I deliberately choose this winnt-only variant. If someone confirm that current (at least bzr 0.7) pass all tests on win98 I will rewrie bzr.bat generator.