Support SVN 1.9 (nonexistent) diffs with relocation info.
Review Request #8146 — Created May 6, 2016 and submitted
Subversion 1.9 introduced the '(nonexistent)' revision as part of the revision string for newly created files in patches, where earlier versions create '(revision 0)' instead.
Revision string handling must cover some variants and shall extract relocation information -if any- (when creating svn diffs between branches), handle a date string (created by svnlook diff) and extract the revision number or the '(nonexistent)' expression.
The current support in reviewboad for '(nonexistent)' revision specifier does not handle diffs created between branches and does not handle diffs created by svnlook with additional date information.
This patch merges the code paths for subversion 1.9 ('nonexistent') revision specifiers and the already existing revision parser regex.
Patches created with earlier subversion clients are properly handled, as well.
A new unit test is included for the '(nonexistent)' revision string as seen in diffs between branches.
Uploading a SVN 1.9 diff with relocation information is successful.
Ran unittests.
Description | From | Last Updated |
---|---|---|
Retain comments to indicate the languages. |
gmyers | |
What happened to group 3? Can we use (?: like we did before so we don't lose a group number? |
chipx86 | |
Why the None? We just didn't have a group matching? Shouldn't there have been something there at least? Should also … |
chipx86 | |
We should have a new unit test for this, rather than reusing this one. This is really about the "nonexistent" … |
chipx86 | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 1 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 1 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (99 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
information, not informationen. |
gmyers |
-
Does this retain all support for all prior versions?
The description in the review request (which we'll use for the commit message) should ideally contain more information on what was broken, how it's been fixed, and note that all prior versions are supported (assuming they are). We have a write-up on what we like to see at https://www.reviewboard.org/docs/codebase/dev/writing-good-descriptions/.
Some good information to include would be the older format for these types of revision indicators in diffs, and the newer format, for comparison purposes.
The info you have on the regex in your other reply would be good to have in the source code, so it's more clear when reviewing and down the road when further changes are made. (Really, we should have been documenting all the formats this whole time..)
-
-
Why the
None
? We just didn't have a group matching? Shouldn't there have been something there at least?Should also use a tuple instead of a list here, as it's lighter-weight.
-
We should have a new unit test for this, rather than reusing this one. This is really about the "nonexistent" string alone, but a new test would be about that + branch names. It could also include the localized versions, to verify.
Can you think of any other tests that would help prove this change? Other cases we're not already covering?
- Change Summary:
-
- added proper comments to the complex regex
- created new unittest case for (nonexistent) and relocation information.
- Description:
-
~ Merge the code paths for subversion 1.9 "nonexistent" revision markers and the already existing revision parser.
~ Subversion 1.9 introduced the '(nonexistent)' revision as part of the revision string for newly created files in patches, where earlier versions create '(revision 0)' instead.
- This will handle the already known cases where subversion prepends relocation information, inserts timestamps. - Additionally handles the 'nonexistent' revision specifier. ~ Extend Unit test to include a testcase in the with relocation information and (nonexistent) revision string.
~ Revision string handling must cover some variants and shall extract relocation information -if any- (when creating svn diffs between branches), handle a date string (created by svnlook diff) and extract the revision number or the '(nonexistent)' expression.
+ + The current support in reviewboad for '(nonexistent)' revision specifier does not handle diffs created between branches and does not handle diffs created by svnlook with additional date information.
+ + This patch merges the code paths for subversion 1.9 ('nonexistent') revision specifiers and the already existing revision parser regex.
+ + + + Patches created with earlier subversion clients are properly handled, as well.
+ + A new unit test is included for the '(nonexistent)' revision string as seen in diffs between branches.
- Bugs:
-
Tool: Pyflakes Processed Files: reviewboard/scmtools/tests.py reviewboard/scmtools/svn/__init__.py Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/tests.py reviewboard/scmtools/svn/__init__.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/tests.py reviewboard/scmtools/svn/__init__.py
-
-
-
-
Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/tests.py reviewboard/scmtools/svn/__init__.py