tests/test-topic-push.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 27 Sep 2017 16:30:43 +0200
changeset 3014 14572c0513a9
parent 3013 945a0989e41b
child 3091 c29a19413e92
permissions -rw-r--r--
packaging: update version to match development version This helps avoid confusion when installing from source.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2045
db617700d318 tests: move "test setup" script into a 'testlib' directory
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2018
diff changeset
     1
  $ . "$TESTDIR/testlib/topic_setup.sh"
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     2
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     3
  $ cat << EOF >> $HGRCPATH
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     4
  > [ui]
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     5
  > logtemplate = {rev} {branch} {get(namespaces, "topics")} {phase} {desc|firstline}\n
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     6
  > ssh =python "$RUNTESTDIR/dummyssh"
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     7
  > EOF
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     8
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     9
  $ hg init main
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    10
  $ hg init draft
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    11
  $ cat << EOF >> draft/.hg/hgrc
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    12
  > [phases]
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    13
  > publish=False
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    14
  > EOF
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    15
  $ hg clone main client
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    16
  updating to branch default
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    17
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    18
  $ cat << EOF >> client/.hg/hgrc
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    19
  > [paths]
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    20
  > draft=../draft
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    21
  > EOF
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    22
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    23
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    24
Testing core behavior to make sure we did not break anything
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    25
============================================================
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    26
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    27
Pushing a first changeset
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    28
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    29
  $ cd client
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    30
  $ echo aaa > aaa
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    31
  $ hg add aaa
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    32
  $ hg commit -m 'CA'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    33
  $ hg outgoing -G
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
    34
  comparing with $TESTTMP/main (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    35
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    36
  @  0 default  draft CA
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    37
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    38
  $ hg push
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
    39
  pushing to $TESTTMP/main (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    40
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    41
  adding changesets
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    42
  adding manifests
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    43
  adding file changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    44
  added 1 changesets with 1 changes to 1 files
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    45
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    46
Pushing two heads
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    47
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    48
  $ echo aaa > bbb
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    49
  $ hg add bbb
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    50
  $ hg commit -m 'CB'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    51
  $ echo aaa > ccc
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    52
  $ hg up 'desc(CA)'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    53
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    54
  $ hg add ccc
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    55
  $ hg commit -m 'CC'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    56
  created new head
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    57
  $ hg outgoing -G
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
    58
  comparing with $TESTTMP/main (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    59
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    60
  @  2 default  draft CC
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    61
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    62
  o  1 default  draft CB
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    63
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    64
  $ hg push
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
    65
  pushing to $TESTTMP/main (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    66
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    67
  abort: push creates new remote head 9fe81b7f425d!
2018
de3304f76fa6 test: adapt to change in mercurial output
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1953
diff changeset
    68
  (merge or see 'hg help push' for details about pushing new heads)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    69
  [255]
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    70
  $ hg outgoing -r 'desc(CB)' -G
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
    71
  comparing with $TESTTMP/main (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    72
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    73
  o  1 default  draft CB
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    74
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    75
  $ hg push -r 'desc(CB)'
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
    76
  pushing to $TESTTMP/main (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    77
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    78
  adding changesets
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    79
  adding manifests
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    80
  adding file changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    81
  added 1 changesets with 1 changes to 1 files
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    82
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    83
Pushing a new branch
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    84
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    85
  $ hg branch mountain
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    86
  marked working directory as branch mountain
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    87
  (branches are permanent and global, did you want a bookmark?)
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    88
  $ hg commit --amend
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    89
  $ hg outgoing -G
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
    90
  comparing with $TESTTMP/main (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    91
  searching for changes
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
    92
  @  3 mountain  draft CC
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    93
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    94
  $ hg push 
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
    95
  pushing to $TESTTMP/main (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    96
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    97
  abort: push creates new remote branches: mountain!
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    98
  (use 'hg push --new-branch' to create new remote branches)
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    99
  [255]
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   100
  $ hg push --new-branch
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
   101
  pushing to $TESTTMP/main (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   102
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   103
  adding changesets
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   104
  adding manifests
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   105
  adding file changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   106
  added 1 changesets with 1 changes to 1 files (+1 heads)
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   107
  1 new obsolescence markers
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   108
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   109
Including on non-publishing
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   110
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   111
  $ hg push --new-branch draft
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
   112
  pushing to $TESTTMP/draft (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   113
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   114
  adding changesets
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   115
  adding manifests
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   116
  adding file changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   117
  added 3 changesets with 3 changes to 3 files (+1 heads)
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   118
  1 new obsolescence markers
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   119
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   120
Testing topic behavior
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   121
======================
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   122
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   123
Local peer tests
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   124
----------------
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   125
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   126
  $ hg up -r 'desc(CA)'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   127
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   128
  $ hg topic babar
2985
f63c97c01f92 topics/ui: signal when the topics command creates a new (empty) topic
Aurélien Campéas
parents: 2983
diff changeset
   129
  marked working directory as topic: babar
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   130
  $ echo aaa > ddd
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   131
  $ hg add ddd
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   132
  $ hg commit -m 'CD'
2988
62201935e1a7 topics/ui: detect and signal when an empty changeset becomes non-empty
Aurélien Campéas
parents: 2985
diff changeset
   133
  active topic 'babar' grew its first changeset
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   134
  $ hg log -G # keep track of phase because I saw some strange bug during developement
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   135
  @  4 default babar draft CD
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   136
  |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   137
  | o  3 mountain  public CC
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   138
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   139
  | o  1 default  public CB
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   140
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   141
  o  0 default  public CA
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   142
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   143
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   144
Pushing a new topic to a non publishing server should not be seen as a new head
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   145
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   146
  $ hg push draft
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
   147
  pushing to $TESTTMP/draft (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   148
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   149
  adding changesets
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   150
  adding manifests
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   151
  adding file changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   152
  added 1 changesets with 1 changes to 1 files (+1 heads)
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   153
  $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   154
  @  4 default babar draft CD
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   155
  |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   156
  | o  3 mountain  public CC
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   157
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   158
  | o  1 default  public CB
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   159
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   160
  o  0 default  public CA
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   161
  
2982
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   162
push --topic
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   163
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   164
  $ hg log -G -R $TESTTMP/draft
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   165
  o  3 default babar draft CD
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   166
  |
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   167
  | o  2 mountain  public CC
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   168
  |/
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   169
  | o  1 default  public CB
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   170
  |/
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   171
  o  0 default  public CA
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   172
  
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   173
  $ echo bbb >> aaa
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   174
  $ hg commit -m "C'A"
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   175
  $ hg up 1
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   176
  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   177
  $ hg topic --clear
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   178
  $ echo bbb >> bbb
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   179
  $ hg commit -m "C'B"
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   180
  $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   181
  @  6 default  draft C'B
2982
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   182
  |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   183
  | o  5 default babar draft C'A
2982
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   184
  | |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   185
  | o  4 default babar draft CD
2982
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   186
  | |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   187
  | | o  3 mountain  public CC
2982
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   188
  | |/
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   189
  o |  1 default  public CB
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   190
  |/
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   191
  o  0 default  public CA
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   192
  
2983
c0de0010ec30 topic: add a --topic option to "outgoing" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2982
diff changeset
   193
  $ hg outgoing draft --topic babar
c0de0010ec30 topic: add a --topic option to "outgoing" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2982
diff changeset
   194
  comparing with $TESTTMP/draft
c0de0010ec30 topic: add a --topic option to "outgoing" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2982
diff changeset
   195
  searching for changes
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   196
  5 default babar draft C'A
2982
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   197
  $ hg push draft --topic babar
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   198
  pushing to $TESTTMP/draft
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   199
  searching for changes
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   200
  adding changesets
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   201
  adding manifests
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   202
  adding file changes
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   203
  added 1 changesets with 1 changes to 1 files
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   204
  $ hg log -G -R $TESTTMP/draft
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   205
  o  4 default babar draft C'A
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   206
  |
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   207
  o  3 default babar draft CD
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   208
  |
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   209
  | o  2 mountain  public CC
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   210
  |/
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   211
  | o  1 default  public CB
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   212
  |/
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   213
  o  0 default  public CA
fef934b7ed86 topic: add a --topic option to "push" command
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 2929
diff changeset
   214
  
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   215
  $ hg strip --config extensions.strip= --no-backup -r 5: --quiet
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   216
  $ hg strip --config extensions.strip= -R $TESTTMP/draft --no-backup -r 4: --quiet
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   217
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   218
Pushing a new topic to a publishing server should be seen as a new head
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   219
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   220
  $ hg push
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
   221
  pushing to $TESTTMP/main (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   222
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   223
  abort: push creates new remote head 67f579af159d!
2018
de3304f76fa6 test: adapt to change in mercurial output
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1953
diff changeset
   224
  (merge or see 'hg help push' for details about pushing new heads)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   225
  [255]
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   226
  $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   227
  @  4 default babar draft CD
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   228
  |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   229
  | o  3 mountain  public CC
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   230
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   231
  | o  1 default  public CB
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   232
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   233
  o  0 default  public CA
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   234
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   235
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   236
wireprotocol tests
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   237
------------------
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   238
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   239
  $ hg up -r 'desc(CA)'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   240
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   241
  $ hg topic celeste
2985
f63c97c01f92 topics/ui: signal when the topics command creates a new (empty) topic
Aurélien Campéas
parents: 2983
diff changeset
   242
  marked working directory as topic: celeste
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   243
  $ echo aaa > eee
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   244
  $ hg add eee
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   245
  $ hg commit -m 'CE'
2988
62201935e1a7 topics/ui: detect and signal when an empty changeset becomes non-empty
Aurélien Campéas
parents: 2985
diff changeset
   246
  active topic 'celeste' grew its first changeset
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   247
  $ hg log -G # keep track of phase because I saw some strange bug during developement
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   248
  @  5 default celeste draft CE
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   249
  |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   250
  | o  4 default babar draft CD
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   251
  |/
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   252
  | o  3 mountain  public CC
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   253
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   254
  | o  1 default  public CB
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   255
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   256
  o  0 default  public CA
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   257
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   258
1903
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   259
Pushing a new topic to a non publishing server without topic -> new head
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   260
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   261
  $ cat << EOF >> ../draft/.hg/hgrc
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   262
  > [extensions]
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   263
  > topic=!
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   264
  > EOF
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   265
  $ hg push ssh://user@dummy/draft
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   266
  pushing to ssh://user@dummy/draft
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   267
  searching for changes
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   268
  abort: push creates new remote head 84eaf32db6c3!
2018
de3304f76fa6 test: adapt to change in mercurial output
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1953
diff changeset
   269
  (merge or see 'hg help push' for details about pushing new heads)
1903
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   270
  [255]
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   271
  $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   272
  @  5 default celeste draft CE
1903
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   273
  |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   274
  | o  4 default babar draft CD
1903
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   275
  |/
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   276
  | o  3 mountain  public CC
1903
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   277
  |/
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   278
  | o  1 default  public CB
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   279
  |/
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   280
  o  0 default  public CA
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   281
  
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   282
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   283
Pushing a new topic to a non publishing server should not be seen as a new head
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   284
1903
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   285
  $ printf "topic=" >> ../draft/.hg/hgrc
58cdf061d49a topic: don't take topic into account when pushing to non-topic repo
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1887
diff changeset
   286
  $ hg config extensions.topic >> ../draft/.hg/hgrc
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   287
  $ hg push ssh://user@dummy/draft
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   288
  pushing to ssh://user@dummy/draft
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   289
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   290
  remote: adding changesets
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   291
  remote: adding manifests
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   292
  remote: adding file changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   293
  remote: added 1 changesets with 1 changes to 1 files (+1 heads)
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   294
  $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   295
  @  5 default celeste draft CE
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   296
  |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   297
  | o  4 default babar draft CD
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   298
  |/
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   299
  | o  3 mountain  public CC
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   300
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   301
  | o  1 default  public CB
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   302
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   303
  o  0 default  public CA
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   304
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   305
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   306
Pushing a new topic to a publishing server should be seen as a new head
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   307
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   308
  $ hg push ssh://user@dummy/main
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   309
  pushing to ssh://user@dummy/main
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   310
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   311
  abort: push creates new remote head 67f579af159d!
2018
de3304f76fa6 test: adapt to change in mercurial output
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1953
diff changeset
   312
  (merge or see 'hg help push' for details about pushing new heads)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   313
  [255]
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   314
  $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   315
  @  5 default celeste draft CE
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   316
  |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   317
  | o  4 default babar draft CD
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   318
  |/
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   319
  | o  3 mountain  public CC
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   320
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   321
  | o  1 default  public CB
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   322
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   323
  o  0 default  public CA
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   324
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   325
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   326
Check that we reject multiple head on the same topic
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   327
----------------------------------------------------
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   328
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   329
  $ hg up 'desc(CB)'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   330
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   331
  $ hg topic babar
2985
f63c97c01f92 topics/ui: signal when the topics command creates a new (empty) topic
Aurélien Campéas
parents: 2983
diff changeset
   332
  marked working directory as topic: babar
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   333
  $ echo aaa > fff
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   334
  $ hg add fff
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   335
  $ hg commit -m 'CF'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   336
  $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   337
  @  6 default babar draft CF
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   338
  |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   339
  | o  5 default celeste draft CE
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   340
  | |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   341
  | | o  4 default babar draft CD
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   342
  | |/
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   343
  | | o  3 mountain  public CC
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   344
  | |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   345
  o |  1 default  public CB
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   346
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   347
  o  0 default  public CA
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   348
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   349
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   350
  $ hg push draft
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
   351
  pushing to $TESTTMP/draft (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   352
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   353
  abort: push creates new remote head f0bc62a661be on branch 'default:babar'!
2018
de3304f76fa6 test: adapt to change in mercurial output
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1953
diff changeset
   354
  (merge or see 'hg help push' for details about pushing new heads)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   355
  [255]
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   356
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   357
Multiple head on a branch merged in a topic changesets
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   358
------------------------------------------------------------------------
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   359
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   360
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   361
  $ hg up 'desc(CA)'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   362
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   363
  $ echo aaa > ggg
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   364
  $ hg add ggg
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   365
  $ hg commit -m 'CG'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   366
  created new head
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   367
  $ hg up 'desc(CF)'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   368
  switching to topic babar
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   369
  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   370
  $ hg merge 'desc(CG)'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   371
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   372
  (branch merge, don't forget to commit)
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   373
  $ hg commit -m 'CM'
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   374
  $ hg log -G
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   375
  @    8 default babar draft CM
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   376
  |\
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   377
  | o  7 default  draft CG
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   378
  | |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   379
  o |  6 default babar draft CF
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   380
  | |
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   381
  | | o  5 default celeste draft CE
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   382
  | |/
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   383
  | | o  4 default babar draft CD
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   384
  | |/
3013
945a0989e41b packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3000
diff changeset
   385
  | | o  3 mountain  public CC
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   386
  | |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   387
  o |  1 default  public CB
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   388
  |/
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   389
  o  0 default  public CA
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   390
  
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   391
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   392
Reject when pushing to draft
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   393
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   394
  $ hg push draft -r .
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
   395
  pushing to $TESTTMP/draft (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   396
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   397
  abort: push creates new remote head 4937c4cad39e!
2018
de3304f76fa6 test: adapt to change in mercurial output
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1953
diff changeset
   398
  (merge or see 'hg help push' for details about pushing new heads)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   399
  [255]
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   400
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   401
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   402
Reject when pushing to publishing
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   403
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   404
  $ hg push -r .
2120
e38156312410 tests: add glob for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 2045
diff changeset
   405
  pushing to $TESTTMP/main (glob)
1886
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   406
  searching for changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   407
  adding changesets
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   408
  adding manifests
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   409
  adding file changes
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   410
  added 3 changesets with 2 changes to 2 files
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   411
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   412
  $ cd ..
0504e76bfbd9 push: allow pushing new topic to non-publishing server by default
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
   413
1887
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   414
Test phase move
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   415
==================================
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   416
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   417
setup, two repo knowns about two small topic branch
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   418
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   419
  $ hg init repoA
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   420
  $ hg clone repoA repoB
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   421
  updating to branch default
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   422
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   423
  $ cat << EOF >> repoA/.hg/hgrc
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   424
  > [phases]
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   425
  > publish=False
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   426
  > EOF
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   427
  $ cat << EOF >> repoB/.hg/hgrc
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   428
  > [phases]
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   429
  > publish=False
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   430
  > EOF
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   431
  $ cd repoA
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   432
  $ echo aaa > base
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   433
  $ hg add base
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   434
  $ hg commit -m 'CBASE'
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   435
  $ echo aaa > aaa
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   436
  $ hg add aaa
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   437
  $ hg topic topicA
2985
f63c97c01f92 topics/ui: signal when the topics command creates a new (empty) topic
Aurélien Campéas
parents: 2983
diff changeset
   438
  marked working directory as topic: topicA
1887
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   439
  $ hg commit -m 'CA'
2988
62201935e1a7 topics/ui: detect and signal when an empty changeset becomes non-empty
Aurélien Campéas
parents: 2985
diff changeset
   440
  active topic 'topicA' grew its first changeset
1887
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   441
  $ hg up 'desc(CBASE)'
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   442
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   443
  $ echo aaa > bbb
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   444
  $ hg add bbb
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   445
  $ hg topic topicB
2985
f63c97c01f92 topics/ui: signal when the topics command creates a new (empty) topic
Aurélien Campéas
parents: 2983
diff changeset
   446
  marked working directory as topic: topicB
1887
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   447
  $ hg commit -m 'CB'
2988
62201935e1a7 topics/ui: detect and signal when an empty changeset becomes non-empty
Aurélien Campéas
parents: 2985
diff changeset
   448
  active topic 'topicB' grew its first changeset
1887
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   449
  $ cd ..
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   450
  $ hg push -R repoA repoB
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   451
  pushing to repoB
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   452
  searching for changes
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   453
  adding changesets
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   454
  adding manifests
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   455
  adding file changes
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   456
  added 3 changesets with 3 changes to 3 files (+1 heads)
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   457
  $ hg log -G -R repoA
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   458
  @  2 default topicB draft CB
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   459
  |
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   460
  | o  1 default topicA draft CA
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   461
  |/
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   462
  o  0 default  draft CBASE
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   463
  
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   464
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   465
We turn different topic to public on each side,
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   466
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   467
  $ hg -R repoA phase --public topicA
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   468
  $ hg -R repoB phase --public topicB
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   469
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   470
Pushing should complain because it create to heads on default
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   471
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   472
  $ hg push -R repoA repoB
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   473
  pushing to repoB
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   474
  searching for changes
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   475
  no changes found
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   476
  abort: push create a new head on branch "default"
68125d026b07 push: hackish handeling of new branch head from phase move
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1886
diff changeset
   477
  [255]