Ticket #3832 (closed defect: worksforme)
Opened 5 years ago
Last modified 5 years ago
Changeset unified diff doesn't work with new files
| Reported by: | paolo | Owned by: | mgood |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | version control | Version: | 0.9.4 |
| Severity: | normal | Keywords: | needinfo |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description
hi,
this issue came up while try to track madwifi (madwifi.org) devel: I'd grab CS then apply in order, but sometime - seems when files are moved around - resulting CS is broken, i.e. don't match what "svn -r ..."
would report. Which sounds pretty wierd - isn't just *that* same command used by TRAC do generate the CS?
For ref. pls see
http://article.gmane.org/gmane.linux.drivers.madwifi.devel/3246/match=ath+hal+directory
Attachments
Change History
comment:1 Changed 5 years ago by cboos
- Keywords needinfo added
comment:2 Changed 5 years ago by mgood
- Keywords needinfo removed
- Milestone set to 0.10.1
- Owner changed from cmlenz to mgood
- Summary changed from changeset generation seems broken: CS sometimes won't match "svn diff -r ..." to Changeset unified diff doesn't work with new files
Yeah, I was very confused by the description for this as well, but after checking the unified diff I can see that the diff headers generated for newly added files are incorrect. This is what Trac generates:
--- (revision ) +++ ah_target.inc (revision 1742) @@ -1,0 +1,36 @@
It should be:
--- ah_target.inc (revision 0) +++ ah_target.inc (revision 1742) @@ -0,0 +1,36 @@
Patch will take the filename from the "---" line, so it needs a filename there. Also patch gets confused by the "-1" indicated that the patch starts at line 1 of the old file and there was no line 1. So, that needs to be line 0.
comment:3 Changed 5 years ago by cboos
I don't remember the details, but I had to make a fix for the Add case in the TracDiff branch quite a while ago. Probably this is needed in the Copy and Rename case too.
comment:4 Changed 5 years ago by mgood
- Keywords needinfo added
AFAICT this should be working. Can you upgrade Trac on madwifi.org to 0.10.3.1 and check that this is working?
comment:5 Changed 5 years ago by mgood
- Resolution set to worksforme
- Status changed from new to closed
I'll take the lack of response as an indication this is not still a problem. Please reopen with more information if it still exists.
comment:6 Changed 5 years ago by mgood
- Milestone 0.10.5 deleted



It's not the same command. Trac uses Python's difflib to compare the two contents.
Plus, I was not really able to relate changeset the http://madwifi.org/changeset/1742 to the example in the mail... can you be more precise about the issue?
Also, as 0.10 is out, it might be a good idea to make a quick experimental install, and check if the problem is still there.