Modify ↓
Opened 10 years ago
Closed 10 years ago
#12341 closed defect (duplicate)
Patch with space in filenames is displayed wrong
| Reported by: | pano | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | rendering | Version: | |
| Severity: | trivial | Keywords: | diff mimeview |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
Paths with spaces contained in patches / diffs are displayed wrong:
-
dir
diff --git a/dir with spaces/filename b/dir with spaces/filename
a b 1 1 abcdef 2 ghijkl -
dirWithoutSpaces/filename
diff --git a/dirWithoutSpaces/filename b/dirWithoutSpaces/filename
a b 1 1 abcdef 2 ghijkl
The first "title" is displayed as just dir when it should actually be dir with spaces/filename.
(Same with attached patches.)
Attachments (0)
Change History (4)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
| Keywords: | mimeview added; patch removed |
|---|---|
| Milestone: | → next-stable-1.0.x |
| Priority: | normal → low |
| Severity: | normal → minor |
comment:3 by , 10 years ago
| Severity: | minor → trivial |
|---|
It wouldn't fix. Another complex case.
$ mkdir 'file.txt a' 'file.txt b' $ echo 1 >./file.txt\ a/file.txt $ echo 1 >./file.txt\ b/file.txt $ git add * $ git commit -a -m test [master c80f2b2] test 2 files changed, 2 insertions(+) create mode 100644 file.txt a/file.txt create mode 100644 file.txt b/file.txt $ echo 2 >./file.txt\ b/file.txt $ echo 2 >./file.txt\ a/file.txt $ git diff
Diff:
diff --git a/file.txt a/file.txt b/file.txt a/file.txt index d00491f..0cfbf08 100644 --- a/file.txt a/file.txt +++ b/file.txt a/file.txt @@ -1 +1 @@ -1 +2 diff --git a/file.txt b/file.txt b/file.txt b/file.txt index d00491f..0cfbf08 100644 --- a/file.txt b/file.txt +++ b/file.txt b/file.txt @@ -1 +1 @@ -1 +2
I think we should retrieve path from diff --git a/... b/... line, or detect git extended format by the diff --git line.
comment:4 by , 10 years ago
| Milestone: | next-stable-1.0.x |
|---|---|
| Resolution: | → duplicate |
| Status: | new → closed |
A duplicate of #6943.
Note:
See TracTickets
for help on using tickets.



The problem seems to be here: source:trunk/trac/mimeview/patch.py@13930:136,148#L134
Change both occurrences of
split(None, 2)tosplit(None, 1)to fix it. But I don't know what[rev]could be.oldrevandnewrevseem to get ignored anyway.