##// END OF EJS Templates
commit: note new branch heads rather than topological heads...
Matt Mackall -
r11173:5b48d819 default
parent child Browse files
Show More
@@ -730,30 +730,29 b' def commit(ui, repo, *pats, **opts):'
730 return repo.commit(message, opts.get('user'), opts.get('date'), match,
730 return repo.commit(message, opts.get('user'), opts.get('date'), match,
731 editor=e, extra=extra)
731 editor=e, extra=extra)
732
732
733 branch = repo[None].branch()
734 bheads = repo.branchheads(branch)
735
733 node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
736 node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
734 if not node:
737 if not node:
735 ui.status(_("nothing changed\n"))
738 ui.status(_("nothing changed\n"))
736 return
739 return
737 cl = repo.changelog
740
738 rev = cl.rev(node)
741 ctx = repo[node]
739 parents = cl.parentrevs(rev)
742 parents = ctx.parents()
740 if rev - 1 in parents:
743
741 # one of the parents was the old tip
744 if bheads and [x for x in parents if x.node() not in bheads]:
742 pass
743 elif (parents == (nullrev, nullrev) or
744 len(cl.heads(cl.node(parents[0]))) > 1 and
745 (parents[1] == nullrev or len(cl.heads(cl.node(parents[1]))) > 1)):
746 ui.status(_('created new head\n'))
745 ui.status(_('created new head\n'))
747
746
748 if not opts.get('close_branch'):
747 if not opts.get('close_branch'):
749 for r in parents:
748 for r in parents:
750 if repo[r].extra().get('close'):
749 if r.extra().get('close'):
751 ui.status(_('reopening closed branch head %d\n') % r)
750 ui.status(_('reopening closed branch head %d\n') % r)
752
751
753 if ui.debugflag:
752 if ui.debugflag:
754 ui.write(_('committed changeset %d:%s\n') % (rev, hex(node)))
753 ui.write(_('committed changeset %d:%s\n') % (int(ctx), ctx.hex()))
755 elif ui.verbose:
754 elif ui.verbose:
756 ui.write(_('committed changeset %d:%s\n') % (rev, short(node)))
755 ui.write(_('committed changeset %d:%s\n') % (int(ctx), ctx))
757
756
758 def copy(ui, repo, *pats, **opts):
757 def copy(ui, repo, *pats, **opts):
759 """mark files as copied for the next commit
758 """mark files as copied for the next commit
@@ -10,7 +10,6 b' 1: Adding a branch (a)'
10 =======
10 =======
11 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
11 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
12 marked working directory as branch b
12 marked working directory as branch b
13 created new head
14 2: Adding b branch (b)
13 2: Adding b branch (b)
15 1: Adding a branch (a)
14 1: Adding a branch (a)
16 0: Adding root node ()
15 0: Adding root node ()
@@ -2,7 +2,6 b' marked working directory as branch a'
2 adding foo
2 adding foo
3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4 marked working directory as branch c
4 marked working directory as branch c
5 created new head
6 requesting all changes
5 requesting all changes
7 adding changesets
6 adding changesets
8 adding manifests
7 adding manifests
@@ -3,7 +3,6 b' marked working directory as branch q'
3 reset working directory to branch a
3 reset working directory to branch a
4 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
4 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
5 marked working directory as branch b
5 marked working directory as branch b
6 created new head
7 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
6 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
8 marked working directory as branch c
7 marked working directory as branch c
9 abort: the name 'tip' is reserved
8 abort: the name 'tip' is reserved
@@ -4,11 +4,9 b' adding bar'
4 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
4 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
5 marked working directory as branch mine
5 marked working directory as branch mine
6 adding world
6 adding world
7 created new head
8 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
7 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
9 marked working directory as branch other
8 marked working directory as branch other
10 adding bye
9 adding bye
11 created new head
12 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
10 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
13 % test -U -u
11 % test -U -u
14 abort: cannot specify both --noupdate and --updaterev
12 abort: cannot specify both --noupdate and --updaterev
@@ -66,7 +66,6 b' 1 files updated, 0 files merged, 1 files'
66
66
67 % add branch 'stable' to repo a for later tests
67 % add branch 'stable' to repo a for later tests
68 marked working directory as branch stable
68 marked working directory as branch stable
69 created new head
70 % tag ref2
69 % tag ref2
71
70
72 % updating back to ref2
71 % updating back to ref2
@@ -3,7 +3,6 b' marked working directory as branch branc'
3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4 marked working directory as branch branchb
4 marked working directory as branch branchb
5 adding b
5 adding b
6 created new head
7 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
6 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
8 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
7 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
9 % convert with datesort
8 % convert with datesort
@@ -86,7 +86,6 b' marked working directory as branch a'
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 marked working directory as branch b
87 marked working directory as branch b
88 adding b
88 adding b
89 created new head
90
89
91 % pull in change on foreign branch
90 % pull in change on foreign branch
92 updating to branch default
91 updating to branch default
@@ -156,8 +155,8 b' 1 files updated, 0 files merged, 0 files'
156 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 (branch merge, don't forget to commit)
157 (branch merge, don't forget to commit)
158 created new head
159 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 created new head
161 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 created new head
161 created new head
163 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -184,6 +183,7 b' marked working directory as branch secon'
184 adding b
183 adding b
185 marked working directory as branch default
184 marked working directory as branch default
186 adding c
185 adding c
186 created new head
187 updating to branch default
187 updating to branch default
188 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 % fetch should succeed
189 % fetch should succeed
@@ -5,6 +5,7 b' 0 files updated, 0 files merged, 1 files'
5 fast-forward
5 fast-forward
6 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
7 (branch merge, don't forget to commit)
7 (branch merge, don't forget to commit)
8 created new head
8 bogus fast-forward should fail
9 bogus fast-forward should fail
9 abort: can't merge with ancestor
10 abort: can't merge with ancestor
10 done
11 done
@@ -462,7 +462,6 b' bar'
462 % test restricted mode with transplant -b
462 % test restricted mode with transplant -b
463 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
464 marked working directory as branch foo
464 marked working directory as branch foo
465 created new head
466 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
465 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
467 applying 4aa30d025d50
466 applying 4aa30d025d50
468 4aa30d025d50 transplanted to 5a4da427c162
467 4aa30d025d50 transplanted to 5a4da427c162
@@ -339,7 +339,6 b' marked working directory as branch test'
339 adding b
339 adding b
340 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
340 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
341 adding c
341 adding c
342 created new head
343 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
342 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
344 adding c
343 adding c
345 % log -b default
344 % log -b default
@@ -30,7 +30,6 b' 1 files updated, 0 files merged, 0 files'
30 abort: there is nothing to merge - use "hg update" instead
30 abort: there is nothing to merge - use "hg update" instead
31 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
31 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 marked working directory as branch foobranch
32 marked working directory as branch foobranch
33 created new head
34 % should fail because merge with other branch
33 % should fail because merge with other branch
35 abort: branch 'foobranch' has one head - please merge with an explicit rev
34 abort: branch 'foobranch' has one head - please merge with an explicit rev
36 (run 'hg heads' to see all heads)
35 (run 'hg heads' to see all heads)
@@ -19,9 +19,9 b' adding a'
19 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
19 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
20 marked working directory as branch b
20 marked working directory as branch b
21 adding c
21 adding c
22 created new head
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 (branch merge, don't forget to commit)
23 (branch merge, don't forget to commit)
24 created new head
25 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
25 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
26 changeset: 2:65309210bf4e
26 changeset: 2:65309210bf4e
27 branch: b
27 branch: b
@@ -4,6 +4,7 b' marked working directory as branch bar'
4 % branch shadowing
4 % branch shadowing
5 abort: a branch of the same name already exists (use 'hg update' to switch to it)
5 abort: a branch of the same name already exists (use 'hg update' to switch to it)
6 marked working directory as branch default
6 marked working directory as branch default
7 created new head
7 % there should be only one default branch head
8 % there should be only one default branch head
8 changeset: 3:bf1bc2f45e83
9 changeset: 3:bf1bc2f45e83
9 tag: tip
10 tag: tip
@@ -13,10 +14,10 b' summary: clear branch name'
13
14
14 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 foo
16 foo
16 created new head
17 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
17 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
18 (branch merge, don't forget to commit)
18 (branch merge, don't forget to commit)
19 foo
19 foo
20 created new head
20 changeset: 5:5f8fb06e083e
21 changeset: 5:5f8fb06e083e
21 branch: foo
22 branch: foo
22 tag: tip
23 tag: tip
@@ -112,6 +113,7 b' 0 files updated, 0 files merged, 1 files'
112 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 (branch merge, don't forget to commit)
114 (branch merge, don't forget to commit)
114 foo
115 foo
116 created new head
115 changeset: 6:f0c74f92a385
117 changeset: 6:f0c74f92a385
116 branch: foo
118 branch: foo
117 tag: tip
119 tag: tip
@@ -135,7 +137,6 b' created new head'
135 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
137 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
136 marked working directory as branch test
138 marked working directory as branch test
137 adding e
139 adding e
138 created new head
139 changeset: 4:3a1e01ed1df4
140 changeset: 4:3a1e01ed1df4
140 branch: test
141 branch: test
141 tag: tip
142 tag: tip
@@ -1644,7 +1644,6 b' diff -r 000000000000 -r 8580ff50825a a'
1644 % test outgoing
1644 % test outgoing
1645 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
1645 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
1646 marked working directory as branch test
1646 marked working directory as branch test
1647 created new head
1648 comparing with ../t
1647 comparing with ../t
1649 searching for changes
1648 searching for changes
1650 This patch series consists of 8 patches.
1649 This patch series consists of 8 patches.
@@ -11,7 +11,6 b' 1 files updated, 0 files merged, 0 files'
11 % create branch B
11 % create branch B
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 marked working directory as branch branchB
13 marked working directory as branch branchB
14 created new head
15 % a new branch is there
14 % a new branch is there
16 pulling from ../t
15 pulling from ../t
17 searching for changes
16 searching for changes
@@ -169,6 +169,7 b' marked working directory as branch b'
169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
171 (branch merge, don't forget to commit)
171 (branch merge, don't forget to commit)
172 created new head
172 pushing to j
173 pushing to j
173 searching for changes
174 searching for changes
174 abort: push creates new remote branches: b!
175 abort: push creates new remote branches: b!
@@ -190,7 +191,6 b' 0 files updated, 0 files merged, 0 files'
190 adding b1
191 adding b1
191 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
192 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
192 adding a2
193 adding a2
193 created new head
194 %% glog of local
194 %% glog of local
195 @ 2: A a2
195 @ 2: A a2
196 |
196 |
@@ -222,7 +222,6 b' marked working directory as branch B'
222 adding b
222 adding b
223 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
223 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
224 adding a1
224 adding a1
225 created new head
226 updating to branch A
225 updating to branch A
227 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
226 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
227 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -263,13 +262,14 b' adding a'
263 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
262 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
264 marked working directory as branch B
263 marked working directory as branch B
265 adding b
264 adding b
266 created new head
267 updating to branch B
265 updating to branch B
268 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
267 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
270 marked working directory as branch B
268 marked working directory as branch B
269 created new head
271 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
270 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
272 marked working directory as branch A
271 marked working directory as branch A
272 created new head
273 %% glog of local
273 %% glog of local
274 @ 5: A b3
274 @ 5: A b3
275 |
275 |
@@ -1,6 +1,5 b''
1 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2 marked working directory as branch notdefault
2 marked working directory as branch notdefault
3 created new head
4 @ 4:r1:notdefault
3 @ 4:r1:notdefault
5 |
4 |
6 | o 3:l2:
5 | o 3:l2:
@@ -90,6 +90,7 b' path t'
90 source t
90 source t
91 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
91 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
92 committing subrepository t
92 committing subrepository t
93 created new head
93 searching for copies back to rev 2
94 searching for copies back to rev 2
94 resolving manifests
95 resolving manifests
95 overwrite None partial False
96 overwrite None partial False
@@ -222,16 +223,16 b' adding a'
222 marked working directory as branch br
223 marked working directory as branch br
223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
224 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
224 adding b
225 adding b
225 created new head
226 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
226 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
227 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 (branch merge, don't forget to commit)
228 (branch merge, don't forget to commit)
229 created new head
229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
230 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
230 adding c
231 adding c
231 created new head
232 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
232 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
233 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 (branch merge, don't forget to commit)
234 (branch merge, don't forget to commit)
235 created new head
235 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
236 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
236 adding .hgsub
237 adding .hgsub
237 committing subrepository s
238 committing subrepository s
@@ -241,15 +242,14 b' adding b'
241 committing subrepository s
242 committing subrepository s
242 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
243 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
243 adding c
244 adding c
244 created new head
245 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
245 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
246 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
246 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
247 (branch merge, don't forget to commit)
247 (branch merge, don't forget to commit)
248 created new head
248 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
249 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
249 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 adding d
251 adding d
251 committing subrepository s
252 committing subrepository s
252 created new head
253 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
253 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
254 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 adding e
255 adding e
General Comments 0
You need to be logged in to leave comments. Login now