external patch command not provided by bzr windows installer: makes "bzr patch" fails on win32

Bug #378379 reported by Olivier Bilodeau
58
This bug affects 13 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

`bzr patch` doesn't work on Windows. I know bzr patch is a part of bzrtools but I think this should not be treated as a bzrtools bug because it's a packaging bug: the installer should provide gnuwin32 patch

Here's what happens when running bzr patch:
E:\tomdroid\threading-improvement>bzr patch noNotesMsgFix.patch
bzr: ERROR: Error invoking patch: No such file or directory

After installing gnuwin32 patch (taken from http://gnuwin32.sourceforge.net/packages/patch.htm) and adding it to PATH:
E:\tomdroid\threading-improvement>bzr patch noNotesMsgFix.patch

It worked!

Additionnal info
================

Found the root of my problem (patch not working) when reading: https://bugs.launchpad.net/bzr/+bug/305006/comments/6

OS:
Windows XP SP2

Bzr installer used: bzr-setup-1.14.1-1.exe

E:\tomdroid\threading-improvement>bzr version
Bazaar (bzr) 1.14
  Python interpreter: C:\Program Files\Bazaar\python25.dll 2.5.2
  Python standard library: C:\Program Files\Bazaar\lib\library.zip
  bzrlib: C:\Program Files\Bazaar\lib\library.zip\bzrlib
  Bazaar configuration: C:\Documents and Settings\olivier.bilodeau\Application Data\bazaar\2.0
  Bazaar log file: C:\Documents and Settings\olivier.bilodeau\My Documents\.bzr.log

Copyright 2005, 2006, 2007, 2008, 2009 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and you may use, modify and redistribute it under the terms of the GNU General Public License version 2 or later.

E:\tomdroid\threading-improvement>bzr plugins
bzrtools 1.14
    Various useful commands for working with bzr.

launchpad
    Launchpad.net integration plugin for Bazaar.

netrc_credential_store
    Use ~/.netrc as a credential store for authentication.conf.

qbzr 0.9.9
    QBzr - Qt-based frontend for Bazaar

rebase 0.3
    Rebase support.

svn 0.5.4
    Support for Subversion branches

.bzr.log:
mar. 2009-05-19 11:25:37 -0400
0.062 bzr arguments: [u'patch', u'emptyNotesWarningFix.patch']
0.078 looking for plugins in C:/Documents and Settings/olivier.bilodeau/Application Data/bazaar/2.0/plugins
0.078 looking for plugins in C:/Program Files/Bazaar/plugins
0.250 encoding stdout as sys.stdout encoding 'cp850'
0.296 opening working tree 'E:/tomdroid/threading-improvement'
0.296 Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 727, in exception_to_return_code
  File "bzrlib\commands.pyo", line 922, in run_bzr
  File "C:/Program Files/Bazaar/plugins\bzrtools\command.py", line 13, in run_argv_aliases
  File "bzrlib\commands.pyo", line 559, in run_argv_aliases
  File "C:/Program Files/Bazaar/plugins\bzrtools\command_classes.py", line 141, in run
  File "C:/Program Files/Bazaar/plugins\bzrtools\patch.py", line 34, in patch
  File "C:/Program Files/Bazaar/plugins\bzrtools\patch.py", line 63, in run_patch
PatchInvokeError: Error invoking patch: No such file or directory

0.312 return code 3

Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Martin Pool (mbp)
summary: - patch not provided by bzr windows installer makes bzr patch fails on
- win32
+ external patch command not provided by bzr windows installer: makes "bzr
+ patch" fails on win32
Revision history for this message
Shah Japan (jsh.axelor) wrote :

Thanks Olivier Bilodeau,

After installing gnuwin32 patch (taken from http://gnuwin32.sourceforge.net/packages/patch.htm) and adding it to PATH:
It worked!

Revision history for this message
Satya (satya-bangalore) wrote :

On windows 7
===========

I've done all the above suggested steps (adding gnuwin patch utility on PATH) and still it failed.

TO make it work:

Start cmd as Administrator and then do bzr patch <patch file>. This should work.

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

@Satya: it's possible that your non-admin account has not PATH changes from admin account? To check this start cmd shell as regular user and check output of

set PATH

and then

patch --verison

Revision history for this message
Bastian (baztian) wrote :

See http://sourceforge.net/tracker/index.php?func=detail&aid=1890860&group_id=23617&atid=379173 for a windows 7 resolution.

Patch should really get included into bzr though...

Revision history for this message
André Bachmann (andrebachmann-dd) wrote :

There is still this problem with Bazaar 2.5.1 for Windows. Using gnuwin32 patch from http://gnuwin32.sourceforge.net/packages/patch.htm and copying patch.exe into the Bazaar directory under C:\Program Files solves this.

Revision history for this message
Alvin Penner (apenner) wrote :

This problem still exists.
Running bzr version 2.0.2 on Windows XP.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
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.