comparison tests/test-branch-tag-confict.t @ 13750:7eb82f88e157

# User Dan Villiom Podlaski Christiansen <danchr@gmail.com> # Date 1289564504 -3600 # Node ID b75264c15cc888cf38c3c7b8f619801e3c2589c7 # Parent 89b2e5d940f669e590096c6be70eee61c9172fff revsets: overload the branch() revset to also take a branch name. This should only change semantics in the specific case of a tag/branch conflict where the tag wasn't done on the branch with the same name. Previously, branch(whatever) would resolve to the branch of the tag in that case, whereas now it will resolve to the branch of the name. The previous behaviour, while documented, seemed very counter-intuitive to me. An alternate approach would be to introduce a new revset such as branchname() or namedbranch(). While this would retain backwards compatibility, the distinction between it and branch() would not be readily apparent to users. The most intuitive behaviour would be to have branch(x) require 'x' to be a branch name, and something like branchof(x) or samebranch(x) do what branch(x) currently does. Unfortunately, our backwards compatibility guarantees prevent us from doing that. Please note that while 'hg tag' guards against shadowing a branch, 'hg branch' does not. Besides, even if it did, that wouldn't solve the issue of conversions with such tags and branches...
author Matt Mackall <mpm@selenic.com>
date Wed, 23 Mar 2011 19:28:16 -0500
parents
children 301725c3df9a
comparison
equal deleted inserted replaced
13749:8bb03283e9b9 13750:7eb82f88e157
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