Show More
@@ -0,0 +1,62 b'' | |||
|
1 | Initial setup. | |
|
2 | ||
|
3 | $ hg init repo | |
|
4 | $ cd repo | |
|
5 | $ touch thefile | |
|
6 | $ hg ci -A -m 'Initial commit.' | |
|
7 | adding thefile | |
|
8 | ||
|
9 | Create a tag. | |
|
10 | ||
|
11 | $ hg tag branchortag | |
|
12 | ||
|
13 | Create a branch with the same name as the tag. | |
|
14 | ||
|
15 | $ hg branch branchortag | |
|
16 | marked working directory as branch branchortag | |
|
17 | $ hg ci -m 'Create a branch with the same name as a tag.' | |
|
18 | ||
|
19 | This is what we have: | |
|
20 | ||
|
21 | $ hg log | |
|
22 | changeset: 2:02b1af9b58c2 | |
|
23 | branch: branchortag | |
|
24 | tag: tip | |
|
25 | user: test | |
|
26 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
27 | summary: Create a branch with the same name as a tag. | |
|
28 | ||
|
29 | changeset: 1:2635c45ca99b | |
|
30 | user: test | |
|
31 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
32 | summary: Added tag branchortag for changeset f57387372b5d | |
|
33 | ||
|
34 | changeset: 0:f57387372b5d | |
|
35 | tag: branchortag | |
|
36 | user: test | |
|
37 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
38 | summary: Initial commit. | |
|
39 | ||
|
40 | Update to the tag: | |
|
41 | ||
|
42 | $ hg up 'tag(branchortag)' | |
|
43 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
44 | $ hg parents | |
|
45 | changeset: 0:f57387372b5d | |
|
46 | tag: branchortag | |
|
47 | user: test | |
|
48 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
49 | summary: Initial commit. | |
|
50 | ||
|
51 | Updating to the branch: | |
|
52 | ||
|
53 | $ hg up 'branch(branchortag)' | |
|
54 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
55 | $ hg parents | |
|
56 | changeset: 2:02b1af9b58c2 | |
|
57 | branch: branchortag | |
|
58 | tag: tip | |
|
59 | user: test | |
|
60 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
61 | summary: Create a branch with the same name as a tag. | |
|
62 |
@@ -298,9 +298,18 b' def children(repo, subset, x):' | |||
|
298 | 298 | return [r for r in subset if r in cs] |
|
299 | 299 | |
|
300 | 300 | def branch(repo, subset, x): |
|
301 | """``branch(set)`` | |
|
302 |
All changesets belonging to the branch |
|
|
301 | """``branch(string or set)`` | |
|
302 | All changesets belonging to the given branch or the branches of the given | |
|
303 | changesets. | |
|
303 | 304 | """ |
|
305 | try: | |
|
306 | b = getstring(x, '') | |
|
307 | if b in repo.branchmap(): | |
|
308 | return [r for r in subset if repo[r].branch() == b] | |
|
309 | except error.ParseError: | |
|
310 | # not a string, but another revspec, e.g. tip() | |
|
311 | pass | |
|
312 | ||
|
304 | 313 | s = getset(repo, range(len(repo)), x) |
|
305 | 314 | b = set() |
|
306 | 315 | for r in s: |
General Comments 0
You need to be logged in to leave comments.
Login now