"bzr shelve" can fail on files in cygwin
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
BzrTools |
New
|
Undecided
|
Mario Đanić |
Bug Description
bzr shelve often fails at the end of the process (after successfully creating the patches) with the error:-
bzr: ERROR: Failed removing shelved changes from theworking tree!
Sample from log:-
0.270 encoding stdout as sys.stdout encoding 'US-ASCII'
0.270 bzr arguments: [u'shelve', u'Controls/
0.270 looking for plugins in /home/johncc/
0.600 looking for plugins in /usr/lib/
0.600 Plugin name __init__ already loaded
0.600 Plugin name __init__ already loaded
0.630 encoding stdout as sys.stdout encoding 'US-ASCII'
0.921 opening working tree '/cygdrive/
11.726 Traceback (most recent call last):
File "commands.py", line 849, in run_bzr_
File "commands.py", line 795, in run_bzr
File "/home/
commands.
File "commands.py", line 495, in run_argv_aliases
File "/home/
s.shelve(
File "/home/
raise CommandError(
BzrCommandError: Failed removing shelved changes from theworking tree!
11.726 return code 3
Experimenting seems to show that it works with files created with Cygwin tools (e.g. vi). I believe it's related to line endings in Windows files combined with the Cygwin/Windows behaviour for text files.
For me, this change in run_patch in patch.py (version 1.8) fixes it.
$ diff bzrtools/patch.py ~/.bazaar/
43c43
< if sys.platform == "win32":
---
> if sys.platform == "win32" or sys.platform == "cygwin":
This causes the "--binary" to be used in cygwin as well as win32.
tags: | added: windows |
As requested in #bzr by pygi