bzr can be caused to error with filenames containing newlines
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
Robert Collins | ||
Launchpad itself |
Fix Released
|
Low
|
Unassigned |
Bug Description
newlines in filenames are uncommon, but possible at least on unix.
"bzr status" shows the filename replacing the newline with a space. That's strange. I'd prefer some kind of escaping ("\n", and "\\" for a real '\'). Furthermore, the filename still appears in the "unknown" section.
bzr diff does not work at all
bzr commit ignores the file
Below is a testcase.
$ mkdir test
$ cd test
$ bzr init
$ touch 'file\
? with newline'
CORRECT>wish newline' (y|n|e|a)? no
$ bzr add file*
added "file
with newline"
$ bzr status
added:
file with newline
unknown:
file
with newline
$ bzr diff
=== added file 'file with newline'
bzr: ERROR: [Errno 2] No such file or directory: '/tmp/test/file with newline'
command: '/home/moy/bin/bzr' 'diff'
pwd: u'/tmp/test'
error: exceptions.OSError
at /net/ecrins/
see ~/.bzr.log for debug information
$ bzr commit -m "added a file with newline"
bzr: ERROR: no changes to commit
Related branches
- Andrew Bennetts: Approve
-
Diff: 94 lines3 files modifiedNEWS (+31/-0)
bzrlib/mutabletree.py (+5/-0)
bzrlib/tests/per_workingtree/test_smart_add.py (+12/-0)
Changed in bzr: | |
milestone: | none → 2.0.1 |
status: | Confirmed → Fix Released |
assignee: | nobody → Robert Collins (lifeless) |
I know they're possible, but do they actually occur in any trees people might want to version?
I agree they should handled gracefully somehow. Should they just be forbidden?