Show More
@@ -1283,7 +1283,7 b' class queue:' | |||||
1283 | return 1 |
|
1283 | return 1 | |
1284 | self.applied.append(statusentry(revlog.hex(n),'.hg.patches.save.line')) |
|
1284 | self.applied.append(statusentry(revlog.hex(n),'.hg.patches.save.line')) | |
1285 | self.applied_dirty = 1 |
|
1285 | self.applied_dirty = 1 | |
1286 |
self.removeundo( |
|
1286 | self.removeundo(repo) | |
1287 |
|
1287 | |||
1288 | def full_series_end(self): |
|
1288 | def full_series_end(self): | |
1289 | if len(self.applied) > 0: |
|
1289 | if len(self.applied) > 0: |
@@ -58,7 +58,7 b' class changelog(revlog):' | |||||
58 | changelog v0 doesn't use extra |
|
58 | changelog v0 doesn't use extra | |
59 | """ |
|
59 | """ | |
60 | if not text: |
|
60 | if not text: | |
61 | return (nullid, "", (0, 0), [], "", {}) |
|
61 | return (nullid, "", (0, 0), [], "", {'branch': 'default'}) | |
62 | last = text.index("\n\n") |
|
62 | last = text.index("\n\n") | |
63 | desc = util.tolocal(text[last + 2:]) |
|
63 | desc = util.tolocal(text[last + 2:]) | |
64 | l = text[:last].split('\n') |
|
64 | l = text[:last].split('\n') | |
@@ -78,6 +78,8 b' class changelog(revlog):' | |||||
78 | time, timezone, extra = extra_data |
|
78 | time, timezone, extra = extra_data | |
79 | time, timezone = float(time), int(timezone) |
|
79 | time, timezone = float(time), int(timezone) | |
80 | extra = self.decode_extra(extra) |
|
80 | extra = self.decode_extra(extra) | |
|
81 | if not extra.get('branch'): | |||
|
82 | extra['branch'] = 'default' | |||
81 | files = l[3:] |
|
83 | files = l[3:] | |
82 | return (manifest, user, (time, timezone), files, desc, extra) |
|
84 | return (manifest, user, (time, timezone), files, desc, extra) | |
83 |
|
85 | |||
@@ -93,6 +95,8 b' class changelog(revlog):' | |||||
93 | parseddate = "%d %d" % util.parsedate(date) |
|
95 | parseddate = "%d %d" % util.parsedate(date) | |
94 | else: |
|
96 | else: | |
95 | parseddate = "%d %d" % util.makedate() |
|
97 | parseddate = "%d %d" % util.makedate() | |
|
98 | if extra and extra.get("branch") in ("default", ""): | |||
|
99 | del extra["branch"] | |||
96 | if extra: |
|
100 | if extra: | |
97 | extra = self.encode_extra(extra) |
|
101 | extra = self.encode_extra(extra) | |
98 | parseddate = "%s %s" % (parseddate, extra) |
|
102 | parseddate = "%s %s" % (parseddate, extra) |
@@ -263,7 +263,8 b' class changeset_printer(object):' | |||||
263 |
|
263 | |||
264 | self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode))) |
|
264 | self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode))) | |
265 |
|
265 | |||
266 | if branch: |
|
266 | # don't show the default branch name | |
|
267 | if branch != 'default': | |||
267 | branch = util.tolocal(branch) |
|
268 | branch = util.tolocal(branch) | |
268 | self.ui.write(_("branch: %s\n") % branch) |
|
269 | self.ui.write(_("branch: %s\n") % branch) | |
269 | for tag in self.repo.nodetags(changenode): |
|
270 | for tag in self.repo.nodetags(changenode): | |
@@ -402,7 +403,7 b' class changeset_templater(changeset_prin' | |||||
402 |
|
403 | |||
403 | def showbranches(**args): |
|
404 | def showbranches(**args): | |
404 | branch = changes[5].get("branch") |
|
405 | branch = changes[5].get("branch") | |
405 | if branch: |
|
406 | if branch != 'default': | |
406 | branch = util.tolocal(branch) |
|
407 | branch = util.tolocal(branch) | |
407 | return showlist('branch', [branch], plural='branches', **args) |
|
408 | return showlist('branch', [branch], plural='branches', **args) | |
408 |
|
409 |
@@ -257,16 +257,14 b' def branch(ui, repo, label=None, **opts)' | |||||
257 | branch name that shadows an existing branch. |
|
257 | branch name that shadows an existing branch. | |
258 | """ |
|
258 | """ | |
259 |
|
259 | |||
260 |
if label |
|
260 | if label: | |
261 | if not opts.get('force') and label in repo.branchtags(): |
|
261 | if not opts.get('force') and label in repo.branchtags(): | |
262 | if label not in [p.branch() for p in repo.workingctx().parents()]: |
|
262 | if label not in [p.branch() for p in repo.workingctx().parents()]: | |
263 | raise util.Abort(_('a branch of the same name already exists' |
|
263 | raise util.Abort(_('a branch of the same name already exists' | |
264 | ' (use --force to override)')) |
|
264 | ' (use --force to override)')) | |
265 |
repo. |
|
265 | repo.dirstate.setbranch(util.fromlocal(label)) | |
266 | else: |
|
266 | else: | |
267 |
|
|
267 | ui.write("%s\n" % util.tolocal(repo.dirstate.branch())) | |
268 | if b: |
|
|||
269 | ui.write("%s\n" % b) |
|
|||
270 |
|
268 | |||
271 | def branches(ui, repo): |
|
269 | def branches(ui, repo): | |
272 | """list repository named branches |
|
270 | """list repository named branches | |
@@ -1446,7 +1444,7 b' def identify(ui, repo):' | |||||
1446 | if not ui.quiet: |
|
1444 | if not ui.quiet: | |
1447 |
|
1445 | |||
1448 | branch = util.tolocal(repo.workingctx().branch()) |
|
1446 | branch = util.tolocal(repo.workingctx().branch()) | |
1449 | if branch: |
|
1447 | if branch != 'default': | |
1450 | output.append("(%s)" % branch) |
|
1448 | output.append("(%s)" % branch) | |
1451 |
|
1449 | |||
1452 | # multiple tags for a single parent separated by '/' |
|
1450 | # multiple tags for a single parent separated by '/' |
@@ -66,7 +66,7 b' class changectx(object):' | |||||
66 | def date(self): return self._changeset[2] |
|
66 | def date(self): return self._changeset[2] | |
67 | def files(self): return self._changeset[3] |
|
67 | def files(self): return self._changeset[3] | |
68 | def description(self): return self._changeset[4] |
|
68 | def description(self): return self._changeset[4] | |
69 |
def branch(self): return self._changeset[5].get("branch" |
|
69 | def branch(self): return self._changeset[5].get("branch") | |
70 |
|
70 | |||
71 | def parents(self): |
|
71 | def parents(self): | |
72 | """return contexts for each parent changeset""" |
|
72 | """return contexts for each parent changeset""" | |
@@ -412,11 +412,7 b' class workingctx(changectx):' | |||||
412 | def deleted(self): return self._status[3] |
|
412 | def deleted(self): return self._status[3] | |
413 | def unknown(self): return self._status[4] |
|
413 | def unknown(self): return self._status[4] | |
414 | def clean(self): return self._status[5] |
|
414 | def clean(self): return self._status[5] | |
415 | def branch(self): |
|
415 | def branch(self): return self._repo.dirstate.branch() | |
416 | try: |
|
|||
417 | return self._repo.opener("branch").read().strip() |
|
|||
418 | except IOError: |
|
|||
419 | return "" |
|
|||
420 |
|
416 | |||
421 | def parents(self): |
|
417 | def parents(self): | |
422 | """return contexts for each parent changeset""" |
|
418 | """return contexts for each parent changeset""" |
@@ -24,6 +24,7 b' class dirstate(object):' | |||||
24 | self.dirs = None |
|
24 | self.dirs = None | |
25 | self.copymap = {} |
|
25 | self.copymap = {} | |
26 | self.ignorefunc = None |
|
26 | self.ignorefunc = None | |
|
27 | self._branch = None | |||
27 |
|
28 | |||
28 | def wjoin(self, f): |
|
29 | def wjoin(self, f): | |
29 | return os.path.join(self.root, f) |
|
30 | return os.path.join(self.root, f) | |
@@ -136,6 +137,15 b' class dirstate(object):' | |||||
136 | self.lazyread() |
|
137 | self.lazyread() | |
137 | return self.pl |
|
138 | return self.pl | |
138 |
|
139 | |||
|
140 | def branch(self): | |||
|
141 | if not self._branch: | |||
|
142 | try: | |||
|
143 | self._branch = self.opener("branch").read().strip()\ | |||
|
144 | or "default" | |||
|
145 | except IOError: | |||
|
146 | self._branch = "default" | |||
|
147 | return self._branch | |||
|
148 | ||||
139 | def markdirty(self): |
|
149 | def markdirty(self): | |
140 | if not self.dirty: |
|
150 | if not self.dirty: | |
141 | self.dirty = 1 |
|
151 | self.dirty = 1 | |
@@ -145,6 +155,10 b' class dirstate(object):' | |||||
145 | self.markdirty() |
|
155 | self.markdirty() | |
146 | self.pl = p1, p2 |
|
156 | self.pl = p1, p2 | |
147 |
|
157 | |||
|
158 | def setbranch(self, branch): | |||
|
159 | self._branch = branch | |||
|
160 | self.opener("branch", "w").write(branch + '\n') | |||
|
161 | ||||
148 | def state(self, key): |
|
162 | def state(self, key): | |
149 | try: |
|
163 | try: | |
150 | return self[key][0] |
|
164 | return self[key][0] |
@@ -15,7 +15,6 b' import os, revlog, time, util' | |||||
15 | class localrepository(repo.repository): |
|
15 | class localrepository(repo.repository): | |
16 | capabilities = ('lookup', 'changegroupsubset') |
|
16 | capabilities = ('lookup', 'changegroupsubset') | |
17 | supported = ('revlogv1', 'store') |
|
17 | supported = ('revlogv1', 'store') | |
18 | branchcache_features = ('unnamed',) |
|
|||
19 |
|
18 | |||
20 | def __del__(self): |
|
19 | def __del__(self): | |
21 | self.transhandle = None |
|
20 | self.transhandle = None | |
@@ -395,25 +394,9 b' class localrepository(repo.repository):' | |||||
395 | def _readbranchcache(self): |
|
394 | def _readbranchcache(self): | |
396 | partial = {} |
|
395 | partial = {} | |
397 | try: |
|
396 | try: | |
398 |
f = self.opener("branch |
|
397 | f = self.opener("branch.cache") | |
399 | lines = f.read().split('\n') |
|
398 | lines = f.read().split('\n') | |
400 | f.close() |
|
399 | f.close() | |
401 | features = lines.pop(0).strip() |
|
|||
402 | if not features.startswith('features: '): |
|
|||
403 | raise ValueError(_('branch cache: no features specified')) |
|
|||
404 | features = features.split(' ', 1)[1].split() |
|
|||
405 | missing_features = [] |
|
|||
406 | for feature in self.branchcache_features: |
|
|||
407 | try: |
|
|||
408 | features.remove(feature) |
|
|||
409 | except ValueError, inst: |
|
|||
410 | missing_features.append(feature) |
|
|||
411 | if missing_features: |
|
|||
412 | raise ValueError(_('branch cache: missing features: %s') |
|
|||
413 | % ', '.join(missing_features)) |
|
|||
414 | if features: |
|
|||
415 | raise ValueError(_('branch cache: unknown features: %s') |
|
|||
416 | % ', '.join(features)) |
|
|||
417 | last, lrev = lines.pop(0).split(" ", 1) |
|
400 | last, lrev = lines.pop(0).split(" ", 1) | |
418 | last, lrev = bin(last), int(lrev) |
|
401 | last, lrev = bin(last), int(lrev) | |
419 | if not (lrev < self.changelog.count() and |
|
402 | if not (lrev < self.changelog.count() and | |
@@ -434,8 +417,7 b' class localrepository(repo.repository):' | |||||
434 |
|
417 | |||
435 | def _writebranchcache(self, branches, tip, tiprev): |
|
418 | def _writebranchcache(self, branches, tip, tiprev): | |
436 | try: |
|
419 | try: | |
437 |
f = self.opener("branch |
|
420 | f = self.opener("branch.cache", "w") | |
438 | f.write(" features: %s\n" % ' '.join(self.branchcache_features)) |
|
|||
439 | f.write("%s %s\n" % (hex(tip), tiprev)) |
|
421 | f.write("%s %s\n" % (hex(tip), tiprev)) | |
440 | for label, node in branches.iteritems(): |
|
422 | for label, node in branches.iteritems(): | |
441 | f.write("%s %s\n" % (hex(node), label)) |
|
423 | f.write("%s %s\n" % (hex(node), label)) | |
@@ -759,7 +741,7 b' class localrepository(repo.repository):' | |||||
759 | branchname = "" |
|
741 | branchname = "" | |
760 |
|
742 | |||
761 | if use_dirstate: |
|
743 | if use_dirstate: | |
762 |
oldname = c1[5].get("branch" |
|
744 | oldname = c1[5].get("branch") # stored in UTF-8 | |
763 | if not commit and not remove and not force and p2 == nullid and \ |
|
745 | if not commit and not remove and not force and p2 == nullid and \ | |
764 | branchname == oldname: |
|
746 | branchname == oldname: | |
765 | self.ui.status(_("nothing changed\n")) |
|
747 | self.ui.status(_("nothing changed\n")) |
@@ -493,9 +493,9 b' def update(repo, node, branchmerge, forc' | |||||
493 | if not partial: |
|
493 | if not partial: | |
494 | recordupdates(repo, action, branchmerge) |
|
494 | recordupdates(repo, action, branchmerge) | |
495 | repo.dirstate.setparents(fp1, fp2) |
|
495 | repo.dirstate.setparents(fp1, fp2) | |
|
496 | if not branchmerge: | |||
|
497 | repo.dirstate.setbranch(p2.branch()) | |||
496 | repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3]) |
|
498 | repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3]) | |
497 | if not branchmerge: |
|
|||
498 | repo.opener("branch", "w").write(p2.branch() + "\n") |
|
|||
499 |
|
499 | |||
500 | return stats |
|
500 | return stats | |
501 |
|
501 |
@@ -1,7 +1,6 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | hg init |
|
3 | hg init | |
4 | hg branch dummy # needed so -r "" doesn't point to the unnamed/default branch |
|
|||
5 | touch a |
|
4 | touch a | |
6 | hg add a |
|
5 | hg add a | |
7 | hg ci -m "a" -d "1000000 0" |
|
6 | hg ci -m "a" -d "1000000 0" |
@@ -1,19 +1,19 b'' | |||||
1 | diff -r 4da5fa99f904 b |
|
1 | diff -r acd8075edac9 b | |
2 | --- /dev/null |
|
2 | --- /dev/null | |
3 | +++ b/b |
|
3 | +++ b/b | |
4 | @@ -0,0 +1,1 @@ |
|
4 | @@ -0,0 +1,1 @@ | |
5 | +123 |
|
5 | +123 | |
6 | diff -r 4da5fa99f904 b |
|
6 | diff -r acd8075edac9 b | |
7 | --- /dev/null |
|
7 | --- /dev/null | |
8 | +++ b/b |
|
8 | +++ b/b | |
9 | @@ -0,0 +1,1 @@ |
|
9 | @@ -0,0 +1,1 @@ | |
10 | +123 |
|
10 | +123 | |
11 | diff -r 4da5fa99f904 a |
|
11 | diff -r acd8075edac9 a | |
12 | --- a/a |
|
12 | --- a/a | |
13 | +++ b/a |
|
13 | +++ b/a | |
14 | @@ -0,0 +1,1 @@ |
|
14 | @@ -0,0 +1,1 @@ | |
15 | +foo |
|
15 | +foo | |
16 | diff -r 4da5fa99f904 b |
|
16 | diff -r acd8075edac9 b | |
17 | --- /dev/null |
|
17 | --- /dev/null | |
18 | +++ b/b |
|
18 | +++ b/b | |
19 | @@ -0,0 +1,1 @@ |
|
19 | @@ -0,0 +1,1 @@ |
@@ -126,13 +126,13 b' tip 5:db5' | |||||
126 | Γ© 3:770b9b11621d |
|
126 | Γ© 3:770b9b11621d | |
127 | % ascii |
|
127 | % ascii | |
128 | ? 5:db5520b4645f |
|
128 | ? 5:db5520b4645f | |
129 |
|
|
129 | default 4:9cff3c980b58 | |
130 | % latin-1 |
|
130 | % latin-1 | |
131 | οΏ½ 5:db5520b4645f |
|
131 | οΏ½ 5:db5520b4645f | |
132 |
|
|
132 | default 4:9cff3c980b58 | |
133 | % utf-8 |
|
133 | % utf-8 | |
134 | Γ© 5:db5520b4645f |
|
134 | Γ© 5:db5520b4645f | |
135 |
|
|
135 | default 4:9cff3c980b58 | |
136 | % utf-8 |
|
136 | % utf-8 | |
137 | changeset: 5:db5520b4645f |
|
137 | changeset: 5:db5520b4645f | |
138 | branch: Γ© |
|
138 | branch: Γ© |
@@ -91,6 +91,7 b' manifest: 1:23226e7a252cacdc2d99e4fbd' | |||||
91 | user: test |
|
91 | user: test | |
92 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
92 | date: Thu Jan 01 00:00:01 1970 +0000 | |
93 | files+: b |
|
93 | files+: b | |
|
94 | extra: branch=default | |||
94 | description: |
|
95 | description: | |
95 | b |
|
96 | b | |
96 |
|
97 | |||
@@ -102,6 +103,7 b' manifest: 0:a0c8bcbbb45c63b90b70ad007' | |||||
102 | user: test |
|
103 | user: test | |
103 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
104 | date: Thu Jan 01 00:00:01 1970 +0000 | |
104 | files+: a |
|
105 | files+: a | |
|
106 | extra: branch=default | |||
105 | description: |
|
107 | description: | |
106 | a |
|
108 | a | |
107 |
|
109 |
@@ -47,7 +47,6 b' hg log -pv d' | |||||
47 | # log --follow tests |
|
47 | # log --follow tests | |
48 | hg init ../follow |
|
48 | hg init ../follow | |
49 | cd ../follow |
|
49 | cd ../follow | |
50 | hg branch dummy # needed so -r "" doesn't point to the unnamed/default branch |
|
|||
51 | echo base > base |
|
50 | echo base > base | |
52 | hg ci -Ambase -d '1 0' |
|
51 | hg ci -Ambase -d '1 0' | |
53 |
|
52 |
@@ -105,22 +105,19 b' adding base' | |||||
105 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
105 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
106 | adding b1 |
|
106 | adding b1 | |
107 | % log -f |
|
107 | % log -f | |
108 |
changeset: 3: |
|
108 | changeset: 3:e62f78d544b4 | |
109 | branch: dummy |
|
|||
110 | tag: tip |
|
109 | tag: tip | |
111 |
parent: 1: |
|
110 | parent: 1:3d5bf5654eda | |
112 | user: test |
|
111 | user: test | |
113 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
112 | date: Thu Jan 01 00:00:01 1970 +0000 | |
114 | summary: b1 |
|
113 | summary: b1 | |
115 |
|
114 | |||
116 |
changeset: 1: |
|
115 | changeset: 1:3d5bf5654eda | |
117 | branch: dummy |
|
|||
118 | user: test |
|
116 | user: test | |
119 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
117 | date: Thu Jan 01 00:00:01 1970 +0000 | |
120 | summary: r1 |
|
118 | summary: r1 | |
121 |
|
119 | |||
122 |
changeset: 0: |
|
120 | changeset: 0:67e992f2c4f3 | |
123 | branch: dummy |
|
|||
124 | user: test |
|
121 | user: test | |
125 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
122 | date: Thu Jan 01 00:00:01 1970 +0000 | |
126 | summary: base |
|
123 | summary: base | |
@@ -128,21 +125,18 b' summary: base' | |||||
128 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
125 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
129 | adding b2 |
|
126 | adding b2 | |
130 | % log -f -r 1:tip |
|
127 | % log -f -r 1:tip | |
131 |
changeset: 1: |
|
128 | changeset: 1:3d5bf5654eda | |
132 | branch: dummy |
|
|||
133 | user: test |
|
129 | user: test | |
134 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
130 | date: Thu Jan 01 00:00:01 1970 +0000 | |
135 | summary: r1 |
|
131 | summary: r1 | |
136 |
|
132 | |||
137 |
changeset: 2: |
|
133 | changeset: 2:60c670bf5b30 | |
138 | branch: dummy |
|
|||
139 | user: test |
|
134 | user: test | |
140 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
135 | date: Thu Jan 01 00:00:01 1970 +0000 | |
141 | summary: r2 |
|
136 | summary: r2 | |
142 |
|
137 | |||
143 |
changeset: 3: |
|
138 | changeset: 3:e62f78d544b4 | |
144 | branch: dummy |
|
139 | parent: 1:3d5bf5654eda | |
145 | parent: 1:fb3d4e35b279 |
|
|||
146 | user: test |
|
140 | user: test | |
147 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
141 | date: Thu Jan 01 00:00:01 1970 +0000 | |
148 | summary: b1 |
|
142 | summary: b1 | |
@@ -151,66 +145,57 b' 2 files updated, 0 files merged, 1 files' | |||||
151 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
145 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
152 | (branch merge, don't forget to commit) |
|
146 | (branch merge, don't forget to commit) | |
153 | % log --follow-first |
|
147 | % log --follow-first | |
154 |
changeset: 6: |
|
148 | changeset: 6:2404bbcab562 | |
155 | branch: dummy |
|
|||
156 | tag: tip |
|
149 | tag: tip | |
157 | user: test |
|
150 | user: test | |
158 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
151 | date: Thu Jan 01 00:00:01 1970 +0000 | |
159 | summary: b1.1 |
|
152 | summary: b1.1 | |
160 |
|
153 | |||
161 |
changeset: 5: |
|
154 | changeset: 5:302e9dd6890d | |
162 | branch: dummy |
|
155 | parent: 3:e62f78d544b4 | |
163 |
parent: |
|
156 | parent: 4:ddb82e70d1a1 | |
164 | parent: 4:b76598590bc3 |
|
|||
165 | user: test |
|
157 | user: test | |
166 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
158 | date: Thu Jan 01 00:00:01 1970 +0000 | |
167 | summary: m12 |
|
159 | summary: m12 | |
168 |
|
160 | |||
169 |
changeset: 3: |
|
161 | changeset: 3:e62f78d544b4 | |
170 | branch: dummy |
|
162 | parent: 1:3d5bf5654eda | |
171 | parent: 1:fb3d4e35b279 |
|
|||
172 | user: test |
|
163 | user: test | |
173 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
164 | date: Thu Jan 01 00:00:01 1970 +0000 | |
174 | summary: b1 |
|
165 | summary: b1 | |
175 |
|
166 | |||
176 |
changeset: 1: |
|
167 | changeset: 1:3d5bf5654eda | |
177 | branch: dummy |
|
|||
178 | user: test |
|
168 | user: test | |
179 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
169 | date: Thu Jan 01 00:00:01 1970 +0000 | |
180 | summary: r1 |
|
170 | summary: r1 | |
181 |
|
171 | |||
182 |
changeset: 0: |
|
172 | changeset: 0:67e992f2c4f3 | |
183 | branch: dummy |
|
|||
184 | user: test |
|
173 | user: test | |
185 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
174 | date: Thu Jan 01 00:00:01 1970 +0000 | |
186 | summary: base |
|
175 | summary: base | |
187 |
|
176 | |||
188 | % log -P 2 |
|
177 | % log -P 2 | |
189 |
changeset: 6: |
|
178 | changeset: 6:2404bbcab562 | |
190 | branch: dummy |
|
|||
191 | tag: tip |
|
179 | tag: tip | |
192 | user: test |
|
180 | user: test | |
193 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
181 | date: Thu Jan 01 00:00:01 1970 +0000 | |
194 | summary: b1.1 |
|
182 | summary: b1.1 | |
195 |
|
183 | |||
196 |
changeset: 5: |
|
184 | changeset: 5:302e9dd6890d | |
197 | branch: dummy |
|
185 | parent: 3:e62f78d544b4 | |
198 |
parent: |
|
186 | parent: 4:ddb82e70d1a1 | |
199 | parent: 4:b76598590bc3 |
|
|||
200 | user: test |
|
187 | user: test | |
201 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
188 | date: Thu Jan 01 00:00:01 1970 +0000 | |
202 | summary: m12 |
|
189 | summary: m12 | |
203 |
|
190 | |||
204 |
changeset: 4: |
|
191 | changeset: 4:ddb82e70d1a1 | |
205 | branch: dummy |
|
192 | parent: 0:67e992f2c4f3 | |
206 | parent: 0:ea445bfed6b9 |
|
|||
207 | user: test |
|
193 | user: test | |
208 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
194 | date: Thu Jan 01 00:00:01 1970 +0000 | |
209 | summary: b2 |
|
195 | summary: b2 | |
210 |
|
196 | |||
211 |
changeset: 3: |
|
197 | changeset: 3:e62f78d544b4 | |
212 | branch: dummy |
|
198 | parent: 1:3d5bf5654eda | |
213 | parent: 1:fb3d4e35b279 |
|
|||
214 | user: test |
|
199 | user: test | |
215 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
200 | date: Thu Jan 01 00:00:01 1970 +0000 | |
216 | summary: b1 |
|
201 | summary: b1 |
@@ -5,7 +5,7 b" echo 'hgext.mq=' >> $HGRCPATH" | |||||
5 |
|
5 | |||
6 | show_branch_cache() |
|
6 | show_branch_cache() | |
7 | { |
|
7 | { | |
8 |
branches=.hg/branch |
|
8 | branches=.hg/branch.cache | |
9 | # force cache (re)generation |
|
9 | # force cache (re)generation | |
10 | hg log -r does-not-exist 2> /dev/null |
|
10 | hg log -r does-not-exist 2> /dev/null | |
11 | hg log -r tip --template 'tip: #rev#\n' |
|
11 | hg log -r tip --template 'tip: #rev#\n' | |
@@ -61,7 +61,7 b' show_branch_cache 1' | |||||
61 |
|
61 | |||
62 | echo |
|
62 | echo | |
63 | echo '# removing the cache' |
|
63 | echo '# removing the cache' | |
64 |
rm .hg/branch |
|
64 | rm .hg/branch.cache | |
65 | show_branch_cache 1 |
|
65 | show_branch_cache 1 | |
66 |
|
66 | |||
67 | echo |
|
67 | echo |
@@ -1,13 +1,12 b'' | |||||
1 | # mq patch on an empty repo |
|
1 | # mq patch on an empty repo | |
2 | tip: 0 |
|
2 | tip: 0 | |
3 |
No .hg/branch |
|
3 | No .hg/branch.cache | |
4 | tip: 0 |
|
4 | tip: 0 | |
5 |
No .hg/branch |
|
5 | No .hg/branch.cache | |
6 |
|
6 | |||
7 | # some regular revisions |
|
7 | # some regular revisions | |
8 | Patch queue now empty |
|
8 | Patch queue now empty | |
9 | tip: 1 |
|
9 | tip: 1 | |
10 | features: unnamed |
|
|||
11 | 3f910abad313ff802d3a23a7529433872df9b3ae 1 |
|
10 | 3f910abad313ff802d3a23a7529433872df9b3ae 1 | |
12 | 3f910abad313ff802d3a23a7529433872df9b3ae bar |
|
11 | 3f910abad313ff802d3a23a7529433872df9b3ae bar | |
13 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo |
|
12 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo | |
@@ -16,12 +15,10 b' 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff' | |||||
16 | applying p1 |
|
15 | applying p1 | |
17 | Now at: p1 |
|
16 | Now at: p1 | |
18 | tip: 2 |
|
17 | tip: 2 | |
19 | features: unnamed |
|
|||
20 | 3f910abad313ff802d3a23a7529433872df9b3ae 1 |
|
18 | 3f910abad313ff802d3a23a7529433872df9b3ae 1 | |
21 | 3f910abad313ff802d3a23a7529433872df9b3ae bar |
|
19 | 3f910abad313ff802d3a23a7529433872df9b3ae bar | |
22 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo |
|
20 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo | |
23 | tip: 3 |
|
21 | tip: 3 | |
24 | features: unnamed |
|
|||
25 | 3f910abad313ff802d3a23a7529433872df9b3ae 1 |
|
22 | 3f910abad313ff802d3a23a7529433872df9b3ae 1 | |
26 | 3f910abad313ff802d3a23a7529433872df9b3ae bar |
|
23 | 3f910abad313ff802d3a23a7529433872df9b3ae bar | |
27 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo |
|
24 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo | |
@@ -30,7 +27,6 b' branch bar: 2' | |||||
30 |
|
27 | |||
31 | # removing the cache |
|
28 | # removing the cache | |
32 | tip: 3 |
|
29 | tip: 3 | |
33 | features: unnamed |
|
|||
34 | 3f910abad313ff802d3a23a7529433872df9b3ae 1 |
|
30 | 3f910abad313ff802d3a23a7529433872df9b3ae 1 | |
35 | 3f910abad313ff802d3a23a7529433872df9b3ae bar |
|
31 | 3f910abad313ff802d3a23a7529433872df9b3ae bar | |
36 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo |
|
32 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo | |
@@ -39,7 +35,6 b' branch bar: 2' | |||||
39 |
|
35 | |||
40 | # importing rev 1 (the cache now ends in one of the patches) |
|
36 | # importing rev 1 (the cache now ends in one of the patches) | |
41 | tip: 3 |
|
37 | tip: 3 | |
42 | features: unnamed |
|
|||
43 | 3f910abad313ff802d3a23a7529433872df9b3ae 1 |
|
38 | 3f910abad313ff802d3a23a7529433872df9b3ae 1 | |
44 | 3f910abad313ff802d3a23a7529433872df9b3ae bar |
|
39 | 3f910abad313ff802d3a23a7529433872df9b3ae bar | |
45 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo |
|
40 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo | |
@@ -54,6 +49,5 b' applying p1' | |||||
54 | applying p2 |
|
49 | applying p2 | |
55 | Now at: p2 |
|
50 | Now at: p2 | |
56 | tip: 3 |
|
51 | tip: 3 | |
57 | features: unnamed |
|
|||
58 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff 0 |
|
52 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff 0 | |
59 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo |
|
53 | 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo |
@@ -13,8 +13,8 b' hg ci -m "add branch name" -d "1000000 0' | |||||
13 | hg branch bar |
|
13 | hg branch bar | |
14 | hg ci -m "change branch name" -d "1000000 0" |
|
14 | hg ci -m "change branch name" -d "1000000 0" | |
15 | echo % branch shadowing |
|
15 | echo % branch shadowing | |
16 |
hg branch |
|
16 | hg branch default | |
17 |
hg branch -f |
|
17 | hg branch -f default | |
18 | hg ci -m "clear branch name" -d "1000000 0" |
|
18 | hg ci -m "clear branch name" -d "1000000 0" | |
19 |
|
19 | |||
20 | hg co foo |
|
20 | hg co foo | |
@@ -32,39 +32,14 b' hg branches -q' | |||||
32 |
|
32 | |||
33 | echo % test for invalid branch cache |
|
33 | echo % test for invalid branch cache | |
34 | hg rollback |
|
34 | hg rollback | |
35 |
cp .hg/branch |
|
35 | cp .hg/branch.cache .hg/bc-invalid | |
36 | hg log -r foo |
|
36 | hg log -r foo | |
37 |
cp .hg/bc-invalid .hg/branch |
|
37 | cp .hg/bc-invalid .hg/branch.cache | |
38 | hg --debug log -r foo |
|
38 | hg --debug log -r foo | |
39 |
rm .hg/branch |
|
39 | rm .hg/branch.cache | |
40 |
echo corrupted > .hg/branch |
|
40 | echo corrupted > .hg/branch.cache | |
41 | hg log -qr foo |
|
41 | hg log -qr foo | |
42 |
cat .hg/branch |
|
42 | cat .hg/branch.cache | |
43 |
|
||||
44 | echo % test for different branch cache features |
|
|||
45 | echo '4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4' > .hg/branches.cache |
|
|||
46 | hg branches --debug |
|
|||
47 | echo ' features: unnamed dummy foo bar' > .hg/branches.cache |
|
|||
48 | hg branches --debug |
|
|||
49 | echo ' features: dummy' > .hg/branches.cache |
|
|||
50 | hg branches --debug |
|
|||
51 |
|
||||
52 | echo % test old hg reading branch cache with feature list |
|
|||
53 | python << EOF |
|
|||
54 | import binascii |
|
|||
55 | f = file('.hg/branches.cache') |
|
|||
56 | lines = f.read().split('\n') |
|
|||
57 | f.close() |
|
|||
58 | firstline = lines[0] |
|
|||
59 | last, lrev = lines.pop(0).rstrip().split(" ", 1) |
|
|||
60 | try: |
|
|||
61 | last, lrev = binascii.unhexlify(last), int(lrev) |
|
|||
62 | except ValueError, inst: |
|
|||
63 | if str(inst) == "invalid literal for int():%s" % firstline: |
|
|||
64 | print "ValueError raised correctly, good." |
|
|||
65 | else: |
|
|||
66 | print "ValueError: %s" % inst |
|
|||
67 | EOF |
|
|||
68 |
|
43 | |||
69 | echo % update with no arguments: tipmost revision of the current branch |
|
44 | echo % update with no arguments: tipmost revision of the current branch | |
70 | hg up -q -C 0 |
|
45 | hg up -q -C 0 |
@@ -45,10 +45,10 b' date: Mon Jan 12 13:46:40 1970 +0' | |||||
45 | summary: initial |
|
45 | summary: initial | |
46 |
|
46 | |||
47 | foo 5:5f8fb06e083e |
|
47 | foo 5:5f8fb06e083e | |
48 |
|
|
48 | default 3:bf1bc2f45e83 | |
49 | bar 2:67ec16bde7f1 |
|
49 | bar 2:67ec16bde7f1 | |
50 | foo |
|
50 | foo | |
51 |
|
51 | default | ||
52 | bar |
|
52 | bar | |
53 | % test for invalid branch cache |
|
53 | % test for invalid branch cache | |
54 | rolling back last transaction |
|
54 | rolling back last transaction | |
@@ -76,26 +76,10 b' modify a branch' | |||||
76 |
|
76 | |||
77 |
|
77 | |||
78 | 4:4909a3732169 |
|
78 | 4:4909a3732169 | |
79 | features: unnamed |
|
|||
80 | 4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4 |
|
79 | 4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4 | |
81 | bf1bc2f45e834c75404d0ddab57d53beab56e2f8 |
|
80 | bf1bc2f45e834c75404d0ddab57d53beab56e2f8 default | |
82 | 4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo |
|
81 | 4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo | |
83 | 67ec16bde7f1575d523313b9bca000f6a6f12dca bar |
|
82 | 67ec16bde7f1575d523313b9bca000f6a6f12dca bar | |
84 | % test for different branch cache features |
|
|||
85 | branch cache: no features specified |
|
|||
86 | foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f |
|
|||
87 | 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8 |
|
|||
88 | bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca |
|
|||
89 | branch cache: unknown features: dummy, foo, bar |
|
|||
90 | foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f |
|
|||
91 | 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8 |
|
|||
92 | bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca |
|
|||
93 | branch cache: missing features: unnamed |
|
|||
94 | foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f |
|
|||
95 | 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8 |
|
|||
96 | bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca |
|
|||
97 | % test old hg reading branch cache with feature list |
|
|||
98 | ValueError raised correctly, good. |
|
|||
99 | % update with no arguments: tipmost revision of the current branch |
|
83 | % update with no arguments: tipmost revision of the current branch | |
100 | bf1bc2f45e83 |
|
84 | bf1bc2f45e83 | |
101 | 4909a3732169 (foo) tip |
|
85 | 4909a3732169 (foo) tip |
General Comments 0
You need to be logged in to leave comments.
Login now