bzr.bat works badly on win98

Bug #33367 reported by Martin Pool
2
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_CONSONANTS,RCVD_IN_SORBS_DUL,USER_IN_WHITELIST
 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\Scripts>type bzr.bat
> >> @C:\Python24\python.exe C:\Python24\Scripts\bzr %*
> >>
> >> C:\Python24\Scripts>bzr.bat
> >> bzr: ERROR: unknown command '*'
> >>
> >> C:\Python24\Scripts>
> >>
> >> C:\Python24\Scripts>
> >>
> >> 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\To\python.exe" "C:\Path\To\bzr" $1 $2 $3 $4 $5 $6 $7 $8 $9
>
> (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://maven.apache.org/continuum/scripts/mvn.bat

------------------>8----gvim.bat ------8<-------------

@echo off
rem -- Run Vim --

set VIM=C:\Program Files\Vim

if exist "%VIM%\vim64\gvim.exe" goto havevim
echo "%VIM%\vim64\gvim.exe" not found
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%\vim64\gvim.exe" %VIMARGS%
goto eof

:nofork
start /w "%VIM%\vim64\gvim.exe" %VIMARGS%
goto eof

:ntaction
rem for WinNT we can use %*
if .%VIMNOFORK%==.1 goto noforknt
start "dummy" /b "%VIM%\vim64\gvim.exe" %*
goto eof

:noforknt
start "dummy" /b /wait "%VIM%\vim64\gvim.exe" %*

:eof
set VIMARGS=
set VIMNOFORK=

----- End forwarded message -----
--
Martin

Revision history for this message
Alexander Belchenko (bialix) wrote :

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.

Changed in bzr:
status: Unconfirmed → Confirmed
Revision history for this message
Alexander Belchenko (bialix) wrote :

bzr.dev revno.1906 contains new improvements in setup and installation. It also contains minimal support for win98 -- not so complex arguments hadling as vim does but only %1 ... %9 (for 9 arguments).

Bazaar mostly works on win98 but officially not support this platform. So I think this minimal support of win98 is enough.

Revision history for this message
John A Meinel (jameinel) wrote :

bzr-0.10 should have the improved bzr.bat available on Win98.

Changed in bzr:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.