[Pkg-bazaar-commits] ./bzr/unstable r684: - Strip any number of trailing slashes and backslashes from the path name

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:13:47 UTC 2009


------------------------------------------------------------
revno: 684
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Wed 2005-06-15 13:37:27 +1000
message:
  - Strip any number of trailing slashes and backslashes from the path name
  when creating a new branch name from the user-supplied branch name.
    patch from aaron
modified:
  bzrlib/commands.py
-------------- next part --------------
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2005-06-15 03:30:11 +0000
+++ b/bzrlib/commands.py	2005-06-15 03:37:27 +0000
@@ -537,9 +537,7 @@
                 raise
 
         if to_location is None:
-            to_location = os.path.basename(from_location)
-            # FIXME: If there's a trailing slash, keep removing them
-            # until we find the right bit
+            to_location = os.path.basename(from_location.rstrip("/\\"))
 
         try:
             os.mkdir(to_location)



More information about the Pkg-bazaar-commits mailing list