##// END OF EJS Templates
branch: strip whitespace before testing known branch name...
Yuya Nishihara -
r19180:12dbdd34 stable
parent child Browse files
Show More
@@ -943,6 +943,9 b' def branch(ui, repo, label=None, **opts)'
943 943
944 944 Returns 0 on success.
945 945 """
946 if label:
947 label = label.strip()
948
946 949 if not opts.get('clean') and not label:
947 950 ui.write("%s\n" % repo.dirstate.branch())
948 951 return
@@ -68,6 +68,18 b' invalid characters'
68 68 abort: '\n' cannot be used in a name
69 69 [255]
70 70
71 trailing or leading spaces should be stripped before testing duplicates
72
73 $ hg branch 'b '
74 abort: a branch of the same name already exists
75 (use 'hg update' to switch to it)
76 [255]
77
78 $ hg branch ' b'
79 abort: a branch of the same name already exists
80 (use 'hg update' to switch to it)
81 [255]
82
71 83 verify update will accept invalid legacy branch names
72 84
73 85 $ hg init test-invalid-branch-name
General Comments 0
You need to be logged in to leave comments. Login now