##// END OF EJS Templates
Merge with stable
Matt Mackall -
r10420:41d0ed2c merge default
parent child Browse files
Show More
@@ -218,8 +218,13 b' class changelog(revlog.revlog):'
218 parseddate = "%d %d" % util.parsedate(date)
218 parseddate = "%d %d" % util.parsedate(date)
219 else:
219 else:
220 parseddate = "%d %d" % util.makedate()
220 parseddate = "%d %d" % util.makedate()
221 if extra and extra.get("branch") in ("default", ""):
221 if extra:
222 del extra["branch"]
222 branch = extra.get("branch")
223 if branch in ("default", ""):
224 del extra["branch"]
225 elif branch in (".", "null", "tip"):
226 raise error.RevlogError(_('the name \'%s\' is reserved')
227 % branch)
223 if extra:
228 if extra:
224 extra = encodeextra(extra)
229 extra = encodeextra(extra)
225 parseddate = "%s %s" % (parseddate, extra)
230 parseddate = "%s %s" % (parseddate, extra)
@@ -208,6 +208,8 b' class dirstate(object):'
208 self._pl = p1, p2
208 self._pl = p1, p2
209
209
210 def setbranch(self, branch):
210 def setbranch(self, branch):
211 if branch in ['tip', '.', 'null']:
212 raise util.Abort(_('the name \'%s\' is reserved') % branch)
211 self._branch = branch
213 self._branch = branch
212 self._opener("branch", "w").write(branch + '\n')
214 self._opener("branch", "w").write(branch + '\n')
213
215
@@ -36,6 +36,10 b' hg add c'
36 hg branch c
36 hg branch c
37 hg commit -d '5 0' -m "Adding c branch"
37 hg commit -d '5 0' -m "Adding c branch"
38
38
39 hg branch tip
40 hg branch null
41 hg branch .
42
39 echo 'd' >d
43 echo 'd' >d
40 hg add d
44 hg add d
41 hg branch 'a branch name much longer than the default justification used by branches'
45 hg branch 'a branch name much longer than the default justification used by branches'
@@ -6,6 +6,9 b' marked working directory as branch b'
6 created new head
6 created new head
7 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
7 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
8 marked working directory as branch c
8 marked working directory as branch c
9 abort: the name 'tip' is reserved
10 abort: the name 'null' is reserved
11 abort: the name '.' is reserved
9 marked working directory as branch a branch name much longer than the default justification used by branches
12 marked working directory as branch a branch name much longer than the default justification used by branches
10 a branch name much longer than the default justification used by branches 7:10ff5895aa57
13 a branch name much longer than the default justification used by branches 7:10ff5895aa57
11 b 4:aee39cd168d0
14 b 4:aee39cd168d0
General Comments 0
You need to be logged in to leave comments. Login now