-
-
If this is unnecessary, please remove it. If it will be uncommented in the future, please add a note explaining why it's turned off.
-
-
-
-
-
-
-
-
Python makes it really easy to iterate like this: for line in lines: if not re.match("^\s*$", line): clearcase_diff_lines.append(line) -
-
No parentheses around the while condition. You can also use the for ... in ... syntax to make this a lot more readable.
-
-
-
-
-
-
Add clearcase integration
Review Request #641 — Created Nov. 17, 2008 and discarded
clearcase integration. add a file clearcase.py under scmtools, add a record in file scmtools\fixtures\initial_data.json.
It works fine in our team.
AA
Review request changed
- Change Summary:
-
1. Made the correspond changed according comments. 2. Delete the ClearCaseParser class as for there is no special case needs override DiffParser'd method. 3. Add more comment about how to used it on windows' platform.
-
Lots of little things that should be cleaned up. Some large things, but also a lot of code that can be simplified with some Pythonisms. I am wondering, though, why this converts from a Clearcase diff into a standard GNU diff instead of implementing a diff parser. It seems you should be adding a DiffParser subclass that does the work necessary to parse. What are the differences between Clearcase diffs and standard diffs? We may be able to simplify this code drastically.
-
We can't put code in that's specific to a single platform and requires modification to make it work. What's the reason this can't be used on Windows?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
This could be better written as: clearcase_diff_lines = [ line for line in lines if not re.match("^\s*$", line) ] -
The first part of the if statement should always be true, since we've verified it through the condition in the while loop.
-
-
-
-
-
These should use \t before the (revision ...) instead of spaces. Also, the hard-coded "(revision 100)" seems very bad to me. We need to use actual revisions, but made-up ones.
-
-
These might be better as: newline = "@@ -%s,0 +%s,%s @@" % (old_start + 1, new_start, new_line_num) Same with the other ones.
-
I would do something like: for i in range(i + 1, i + new_line_num): gnu_diff_lines.append("+" + clearcase_diff_lines[i][2:]) -
Similar to above: for i in range(i + 1, i + old_line_num): gnu_diff_lines.append("-" + clearcase_diff_lines[i][2:]) for i in range(i + 1, i + new_line_num): gnu_diff_lines.append("+" + clearcase_diff_lines[i][2:])