tests/test-branch-change.t
author Gregory Szorc <gregory.szorc@gmail.com>
Mon, 24 Sep 2018 09:41:42 -0700
changeset 39861 db5501d93bcf
parent 35771 ebb75443969a
child 40666 69268a13ffa5
permissions -rw-r--r--
changegroup: remove reordering control (BC) This logic - including the experimental bundle.reorder option - was originally added in a8e3931e3fb5 in 2011 and then later ported to changegroup.py. The intent of this option and associated logic is to control the ordering of revisions in deltagroups in changegroups. At the time it was implemented, only changegroup version 1 existed and generaldelta revlogs were just coming into the world. Changegroup version 1 requires that deltas be made against the last revision sent over the wire. Used with generaldelta, this created an impedance mismatch of sorts and resulted in changegroup producers spending a lot of time recomputing deltas. Revision reordering was introduced so outgoing revisions would be sent in "generaldelta order" and producers would be able to reuse internal deltas from storage. Later on, we introduced changegroup version 2. It supported denoting which revision a delta was against. So we no longer needed to sort outgoing revisions to ensure optimal delta generation from the producer. So, subsequent changegroup versions disabled reordering. We also later made the changelog not store deltas by default. And we also made the changelog send out deltas in storage order. Why we do this for changelog, I'm not sure. Maybe we want to preserve revision order across clones? It doesn't really matter for this commit. Fast forward to 2018. We want to abstract storage backends. And having changegroup code require knowledge about how deltas are stored internally interferes with that goal. This commit removes reordering control from changegroup generation. After this commit, the reordering behavior is: * The changelog is always sent out in storage order (no behavior change). * Non-changelog generaldelta revlogs are reordered to always be in DAG topological order (previously, generaldelta revlogs would be emitted in storage order for version 2 and 3 changegroups). * Non-changelog non-generaldelta revlogs are sent in storage order (no behavior change). * There exists no config option to override behavior. The big difference here is that generaldelta revlogs now *always* have their revisions sorted in DAG order before going out over the wire. This behavior was previously only done for changegroup version 1. Version 2 and version 3 changegroups disabled reordering because the interchange format supported encoding arbitrary delta parents, so reordering wasn't strictly necessary. I can think of a few significant implications for this change. Because changegroup receivers will now see non-changelog revisions in DAG order instead of storage order, the internal storage order of manifests and files may differ substantially between producer and consumer. I don't think this matters that much, since the storage order of manifests and files is largely hidden from users. Only the storage order of changelog matters (because `hg log` shows the changelog in storage order). I don't think there should be any controversy here. The reordering of revisions has implications for changegroup producers. Previously, generaldelta revlogs would be emitted in storage order. And in the common case, the internally-stored delta could effectively be copied from disk into the deltagroup delta. This meant that emitting delta groups for generaldelta revlogs would be mostly linear read I/O. This is desirable for performance. With us now reordering generaldelta revlog revisions in DAG order, the read operations may use more random I/O instead of sequential I/O. This could result in performance loss. But with the prevalence of SSDs and fast random I/O, I'm not too worried. (Note: the optimal emission order for revlogs is actually delta encoding order. But the changegroup code wasn't doing that before or after this change. We could potentially implement that in a later commit.) Changegroups in DAG order will have implications for receivers. Previously, receiving storage order might mean seeing a number of interleaved branches. This would mean long delta chains, sparse I/O, and possibly more fulltext revisions instead of deltas, blowing up storage storage. (This is the same set of problems that sparse revlogs aims to address.) With the producer now sending revisions in DAG order, the receiver also stores revisions in DAG order. That means revisions for the same DAG branch are all grouped together. And this should yield better storage outcomes. In other words, sending the reordered changegroup allows the receiver to have better storage order and for the producer to not propagate its (possibly sub-optimal) internal storage order. On the mozilla-unified repository, this change influences bundle generation: $ hg bundle -t none-v2 -a before: time: real 355.680 secs (user 256.790+0.000 sys 16.820+0.000) after: time: real 382.950 secs (user 281.700+0.000 sys 17.690+0.000) before: 7,150,228,967 bytes (uncompressed) after: 7,041,556,273 bytes (uncompressed) before: 1,669,063,234 bytes (zstd l=3) after: 1,628,598,830 bytes (zstd l=3) $ hg unbundle before: time: real 511.910 secs (user 466.750+0.000 sys 32.680+0.000) after: time: real 487.790 secs (user 443.940+0.000 sys 30.840+0.000) 00manifest.d size: source: 274,924,292 bytes before: 304,741,626 bytes after: 245,252,087 bytes .hg/store total file size: source: 2,649,133,490 before: 2,680,888,130 after: 2,627,875,673 We see the bundle size drop. That's probably because if a revlog internally isn't storing a delta, it will choose to delta against the last emitted revision. And on repos with interleaved branches (like mozilla-unified), the previous revision could be an unrelated branch and therefore be a large delta. But with this patch, the previous revision is likely p1 or p2 and a delta should be small. We also see the manifest size drop by ~50 MB. It's worth noting that the manifest actually *increased* in size by ~25 MB in the old strategy and decreased ~25 MB from its source in the new strategy. Again, my explanation for this is that the DAG ordering in the changegroup is resulting in better grouping of revisions in the receiver, which results in more compact delta chains and higher storage efficiency. Unbundle time also dropped. I suspect this is due to the revlog having to work less to compute deltas since the incoming deltas are more optimal. i.e. the receiver spends less time resolving fulltext revisions as incoming deltas bounce around between DAG branches and delta chains. We also see bundle generation time increase. This is not desirable. However, the regression is only significant on the original repository: if we generate a bundle from the repository created from the new, always reordered bundles, we're close to baseline (if not at it with expected noise): $ hg bundle -t none-v2 -a before (original): time: real 355.680 secs (user 256.790+0.000 sys 16.820+0.000) after (original): time: real 382.950 secs (user 281.700+0.000 sys 17.690+0.000) after (new repo): time: real 362.280 secs (user 260.300+0.000 sys 17.700+0.000) This regression is a bit worrying because it will impact serving canonical repositories (that don't have optimal internal storage unless they are reordered - possibly as part of running `hg debugupgraderepo`). However, this regression will only be noticed by very large changegroups. And I'm guessing/hoping that any repository that large is using clonebundles to mitigate server load. Again, sending DAG order isn't the optimal send order for servers: sending in storage-delta order is. But in order to enable storage-optimal send order, we'll need a storage API that handles sorting. Future commits will introduce such an API. Differential Revision: https://phab.mercurial-scm.org/D4721
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     1
Testing changing branch on commits
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     2
==================================
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     3
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     4
Setup
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     5
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     6
  $ cat >> $HGRCPATH << EOF
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     7
  > [alias]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     8
  > glog = log -G -T "{rev}:{node|short} {desc}\n{branch} ({bookmarks})"
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     9
  > [experimental]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    10
  > evolution = createmarkers
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    11
  > [extensions]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    12
  > rebase=
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    13
  > EOF
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    14
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    15
  $ hg init repo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    16
  $ cd repo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    17
  $ for ch in a b c d e; do echo foo >> $ch; hg ci -Aqm "Added "$ch; done
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    18
  $ hg glog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    19
  @  4:aa98ab95a928 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    20
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    21
  o  3:62615734edd5 Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    22
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    23
  o  2:28ad74487de9 Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    24
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    25
  o  1:29becc82797a Added b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    26
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    27
  o  0:18d04c59bb5d Added a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    28
     default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    29
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    30
  $ hg branches
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    31
  default                        4:aa98ab95a928
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    32
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    33
Try without passing a new branch name
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    34
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    35
  $ hg branch -r .
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    36
  abort: no branch name specified for the revisions
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    37
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    38
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    39
Setting an invalid branch name
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    40
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    41
  $ hg branch -r . a:b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    42
  abort: ':' cannot be used in a name
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    43
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    44
  $ hg branch -r . tip
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    45
  abort: the name 'tip' is reserved
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    46
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    47
  $ hg branch -r . 1234
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    48
  abort: cannot use an integer as a name
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    49
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    50
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    51
Change on non-linear set of commits
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    52
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    53
  $ hg branch -r 2 -r 4 foo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    54
  abort: cannot change branch of non-linear revisions
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    55
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    56
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    57
Change in middle of the stack (linear commits)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    58
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    59
  $ hg branch -r 1::3 foo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    60
  abort: cannot change branch of changeset with children
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    61
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    62
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    63
Change with dirty working directory
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    64
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    65
  $ echo bar > a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    66
  $ hg branch -r . foo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    67
  abort: uncommitted changes
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    68
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    69
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    70
  $ hg revert --all
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    71
  reverting a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    72
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    73
Change on empty revision set
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    74
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    75
  $ hg branch -r 'draft() - all()' foo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    76
  abort: empty revision set
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    77
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    78
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    79
Changing branch on linear set of commits from head
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    80
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    81
Without obsmarkers
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    82
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    83
  $ hg branch -r 3:4 foo --config experimental.evolution=!
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    84
  changed branch on 2 changesets
35771
ebb75443969a test-branch-change: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35746
diff changeset
    85
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/62615734edd5-e86bd13a-branch-change.hg
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    86
  $ hg glog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    87
  @  4:3938acfb5c0f Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    88
  |  foo ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    89
  o  3:9435da006bdc Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    90
  |  foo ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    91
  o  2:28ad74487de9 Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    92
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    93
  o  1:29becc82797a Added b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    94
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    95
  o  0:18d04c59bb5d Added a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    96
     default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    97
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    98
  $ hg branches
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    99
  foo                            4:3938acfb5c0f
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   100
  default                        2:28ad74487de9 (inactive)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   101
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   102
With obsmarkers
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   103
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   104
  $ hg branch -r 3::4 bar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   105
  changed branch on 2 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   106
  $ hg glog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   107
  @  6:7c1991464886 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   108
  |  bar ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   109
  o  5:1ea05e93925f Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   110
  |  bar ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   111
  o  2:28ad74487de9 Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   112
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   113
  o  1:29becc82797a Added b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   114
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   115
  o  0:18d04c59bb5d Added a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   116
     default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   117
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   118
  $ hg branches
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   119
  bar                            6:7c1991464886
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   120
  default                        2:28ad74487de9 (inactive)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   121
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   122
Change branch name to an existing branch
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   123
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   124
  $ hg branch -r . default
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   125
  abort: a branch of the same name already exists
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   126
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   127
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   128
Changing on a branch head which is not topological head
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   129
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   130
  $ hg branch -r 2 stable
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   131
  abort: cannot change branch of changeset with children
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   132
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   133
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   134
Enabling the allowunstable config and trying to change branch on a branch head
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   135
which is not a topological head
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   136
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   137
  $ echo "[experimental]" >> .hg/hgrc
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   138
  $ echo "evolution.allowunstable=yes" >> .hg/hgrc
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   139
  $ hg branch -r 2 foo
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   140
  changed branch on 1 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   141
  2 new orphan changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   142
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   143
Changing branch of an obsoleted changeset
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   144
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   145
  $ hg branch -r 4 foobar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   146
  abort: hidden revision '4' was rewritten as: 7c1991464886!
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   147
  (use --hidden to access hidden revisions)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   148
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   149
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   150
  $ hg branch -r 4 --hidden foobar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   151
  abort: cannot change branch of a obsolete changeset
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   152
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   153
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   154
Make sure bookmark movement is correct
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   155
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   156
  $ hg bookmark b1
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   157
  $ hg glog -r '.^::'
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   158
  @  6:7c1991464886 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   159
  |  bar (b1)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   160
  *  5:1ea05e93925f Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   161
  |  bar ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   162
  ~
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   163
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   164
  $ hg branch -r '(.^)::' wat --debug
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   165
  changing branch of '1ea05e93925f806d875a2163f9b76764be644636' from 'bar' to 'wat'
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   166
  committing files:
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   167
  d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   168
  committing manifest
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   169
  committing changelog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   170
  new node id is 343660ccab7400da637bd6a211d07f413536d718
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   171
  changing branch of '7c19914648869f5b02fc7fed31ddee9783fdd680' from 'bar' to 'wat'
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   172
  committing files:
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   173
  e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   174
  committing manifest
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   175
  committing changelog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   176
  new node id is de1404b45a69f8cc6437d7679033ee33e9efb4ba
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   177
  moving bookmarks ['b1'] from 7c19914648869f5b02fc7fed31ddee9783fdd680 to de1404b45a69f8cc6437d7679033ee33e9efb4ba
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   178
  resolving manifests
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   179
   branchmerge: False, force: False, partial: False
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   180
   ancestor: 7c1991464886, local: 7c1991464886+, remote: de1404b45a69
35771
ebb75443969a test-branch-change: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35746
diff changeset
   181
  starting 4 threads for background file closing (?)
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   182
  changed branch on 2 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   183
  updating the branch cache
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   184
  invalid branchheads cache (served): tip differs
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   185
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   186
  $ hg glog -r '(.^)::'
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   187
  @  9:de1404b45a69 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   188
  |  wat (b1)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   189
  *  8:343660ccab74 Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   190
  |  wat ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   191
  ~
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   192
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   193
Make sure phase handling is correct
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   194
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   195
  $ echo foo >> bar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   196
  $ hg ci -Aqm "added bar" --secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   197
  1 new orphan changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   198
  $ hg glog -r .
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   199
  @  10:8ad1294c1660 added bar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   200
  |  wat (b1)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   201
  ~
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   202
  $ hg branch -r . secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   203
  changed branch on 1 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   204
  $ hg phase -r .
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   205
  11: secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   206
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   207
  $ hg branches
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   208
  secret                        11:38a9b2d53f98
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   209
  foo                            7:8a4729a5e2b8
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   210
  wat                            9:de1404b45a69 (inactive)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   211
  default                        2:28ad74487de9 (inactive)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   212
  $ hg branch
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   213
  secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   214
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   215
Changing branch of another head, different from one on which we are
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   216
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   217
  $ hg glog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   218
  @  11:38a9b2d53f98 added bar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   219
  |  secret (b1)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   220
  *  9:de1404b45a69 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   221
  |  wat ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   222
  *  8:343660ccab74 Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   223
  |  wat ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   224
  | o  7:8a4729a5e2b8 Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   225
  | |  foo ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   226
  x |  2:28ad74487de9 Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   227
  |/   default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   228
  o  1:29becc82797a Added b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   229
  |  default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   230
  o  0:18d04c59bb5d Added a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   231
     default ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   232
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   233
  $ hg branch
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   234
  secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   235
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   236
  $ hg branch -r 7 foobar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   237
  changed branch on 1 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   238
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   239
The current branch must be preserved
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   240
  $ hg branch
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   241
  secret
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   242
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   243
Changing branch on multiple heads at once
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   244
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   245
  $ hg rebase -s 8 -d 12 --keepbranches -q
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   246
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   247
  $ hg rebase -s 14 -d 1 --keepbranches -q
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   248
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   249
  $ hg branch -r 0: stable
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   250
  changed branch on 6 changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   251
  $ hg glog
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   252
  @  23:6a5ddbcfb870 added bar
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   253
  |  stable (b1)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   254
  o  22:baedc6e98a67 Added e
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   255
  |  stable ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   256
  | o  21:99ac7bf8aad1 Added d
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   257
  | |  stable ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   258
  | o  20:0ecb4d39c4bd Added c
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   259
  |/   stable ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   260
  o  19:fd45b986b109 Added b
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   261
  |  stable ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   262
  o  18:204d2769eca2 Added a
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   263
     stable ()
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   264
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   265
  $ hg branches
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   266
  stable                        23:6a5ddbcfb870
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   267
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   268
  $ hg branch
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   269
  stable
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   270
35746
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   271
Changing to same branch is no-op
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   272
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   273
  $ hg branch -r 19::21 stable
35746
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   274
  changed branch on 0 changesets
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   275
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   276
Changing branch name to existing branch name if the branch of parent of root of
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   277
revs is same as the new branch name
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   278
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   279
  $ hg branch -r 20::21 bugfix
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   280
  changed branch on 2 changesets
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   281
  $ hg glog
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   282
  o  25:714defe1cf34 Added d
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   283
  |  bugfix ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   284
  o  24:98394def28fc Added c
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   285
  |  bugfix ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   286
  | @  23:6a5ddbcfb870 added bar
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   287
  | |  stable (b1)
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   288
  | o  22:baedc6e98a67 Added e
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   289
  |/   stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   290
  o  19:fd45b986b109 Added b
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   291
  |  stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   292
  o  18:204d2769eca2 Added a
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   293
     stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   294
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   295
  $ hg branch -r 24:25 stable
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   296
  changed branch on 2 changesets
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   297
  $ hg glog
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   298
  o  27:4ec342341562 Added d
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   299
  |  stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   300
  o  26:83f48859c2de Added c
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   301
  |  stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   302
  | @  23:6a5ddbcfb870 added bar
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   303
  | |  stable (b1)
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   304
  | o  22:baedc6e98a67 Added e
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   305
  |/   stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   306
  o  19:fd45b986b109 Added b
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   307
  |  stable ()
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   308
  o  18:204d2769eca2 Added a
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   309
     stable ()
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   310
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   311
Testing on merge
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   312
35746
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   313
  $ hg merge -r 26
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   314
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   315
  (branch merge, don't forget to commit)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   316
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   317
  $ hg branch -r . abcd
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   318
  abort: outstanding uncommitted merge
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   319
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   320
  $ hg ci -m "Merge commit"
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   321
  $ hg branch -r '(.^)::' def
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   322
  abort: cannot change branch of a merge commit
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   323
  [255]
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   324
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   325
Changing branch on public changeset
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   326
35746
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   327
  $ hg phase -r 27 -p
e5b6ba786d83 branch: allow changing branch name to existing name if possible
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35745
diff changeset
   328
  $ hg branch -r 27 def
35745
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   329
  abort: cannot change branch of public changesets
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   330
  (see 'hg help phases' for details)
3bd8ab4c80a5 branch: add a --rev flag to change branch name of given revisions
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   331
  [255]