Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: trychange.py

Issue 118376: Fix bug in PathDifference that truncated paths. (epot_tools) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trychange.py
===================================================================
--- trychange.py (revision 17850)
+++ trychange.py (working copy)
@@ -66,8 +66,11 @@
"""Returns the difference subpath minus root."""
if subpath.find(root) != 0:
return None
- # The + 1 is for the trailing / or \.
- return subpath[len(root) + len(os.sep):]
+ # If the root does not have a trailing \ or /, we add it so the returned path
+ # starts immediately after the seperator regardless of whether it is provided.
+ if not root.endswith(os.sep):
+ root += os.sep
+ return subpath[len(root):]
def GetSourceRoot():
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698