tests/test-topic-flow-publish-flag.t
branchmercurial-4.3
changeset 3187 68aeeb4d4b8f
parent 3186 9d9ff55d1bb1
parent 3176 1b58e0121689
child 3188 4cc1057970a2
child 3273 c0ee9ddfd5ff
equal deleted inserted replaced
3186:9d9ff55d1bb1 3187:68aeeb4d4b8f
     1 =====================
       
     2 Test workflow options
       
     3 =====================
       
     4 
       
     5   $ . "$TESTDIR/testlib/topic_setup.sh"
       
     6   $ . "$TESTDIR/testlib/common.sh"
       
     7 
       
     8 testing hg push --publish flag
       
     9 ==============================
       
    10 
       
    11   $ hg init bare-branch-server
       
    12   $ cd bare-branch-server
       
    13   $ cat <<EOF >> .hg/hgrc
       
    14   > [phases]
       
    15   > publish = no
       
    16   > EOF
       
    17   $ mkcommit ROOT
       
    18   $ mkcommit c_dA0
       
    19   $ hg phase --public -r 'all()'
       
    20   $ cd ..
       
    21 
       
    22   $ hg clone bare-branch-server bare-client
       
    23   updating to branch default
       
    24   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    25   $ cd bare-client
       
    26 
       
    27 Pushing a 1 new changeset
       
    28 -------------------------
       
    29 
       
    30   $ mkcommit c_dB0
       
    31   $ hg push --publish
       
    32   pushing to $TESTTMP/bare-branch-server
       
    33   searching for changes
       
    34   adding changesets
       
    35   adding manifests
       
    36   adding file changes
       
    37   added 1 changesets with 1 changes to 1 files
       
    38   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
    39   @  2:286d02a6e2a2 c_dB0 public default
       
    40   |
       
    41   o  1:134bc3852ad2 c_dA0 public default
       
    42   |
       
    43   o  0:ea207398892e ROOT public default
       
    44   
       
    45 
       
    46 Pushing a 2 new changeset (same branch)
       
    47 ---------------------------------------
       
    48 
       
    49   $ mkcommit c_dC0
       
    50   $ mkcommit c_dD0
       
    51   $ hg push --publish
       
    52   pushing to $TESTTMP/bare-branch-server
       
    53   searching for changes
       
    54   adding changesets
       
    55   adding manifests
       
    56   adding file changes
       
    57   added 2 changesets with 2 changes to 2 files
       
    58   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
    59   @  4:c63e7dd93a91 c_dD0 public default
       
    60   |
       
    61   o  3:7d56a56d2547 c_dC0 public default
       
    62   |
       
    63   o  2:286d02a6e2a2 c_dB0 public default
       
    64   |
       
    65   o  1:134bc3852ad2 c_dA0 public default
       
    66   |
       
    67   o  0:ea207398892e ROOT public default
       
    68   
       
    69 
       
    70 Pushing a 2 new changeset two head
       
    71 ----------------------------------
       
    72 
       
    73   $ mkcommit c_dE0
       
    74   $ hg update 'desc("c_dD0")'
       
    75   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    76   $ hg branch other
       
    77   marked working directory as branch other
       
    78   (branches are permanent and global, did you want a bookmark?)
       
    79   $ mkcommit c_oF0
       
    80   $ hg push -f --publish
       
    81   pushing to $TESTTMP/bare-branch-server
       
    82   searching for changes
       
    83   adding changesets
       
    84   adding manifests
       
    85   adding file changes
       
    86   added 2 changesets with 2 changes to 2 files (+1 heads)
       
    87   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
    88   @  6:45b23c834b6a c_oF0 public other
       
    89   |
       
    90   | o  5:5576ae39eaee c_dE0 public default
       
    91   |/
       
    92   o  4:c63e7dd93a91 c_dD0 public default
       
    93   |
       
    94   o  3:7d56a56d2547 c_dC0 public default
       
    95   |
       
    96   o  2:286d02a6e2a2 c_dB0 public default
       
    97   |
       
    98   o  1:134bc3852ad2 c_dA0 public default
       
    99   |
       
   100   o  0:ea207398892e ROOT public default
       
   101   
       
   102 
       
   103 Publishing 1 common changeset
       
   104 -----------------------------
       
   105   $ mkcommit c_oG0
       
   106   $ hg push
       
   107   pushing to $TESTTMP/bare-branch-server
       
   108   searching for changes
       
   109   adding changesets
       
   110   adding manifests
       
   111   adding file changes
       
   112   added 1 changesets with 1 changes to 1 files
       
   113   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
   114   @  7:d293f74a1233 c_oG0 draft other
       
   115   |
       
   116   o  6:45b23c834b6a c_oF0 public other
       
   117   |
       
   118   | o  5:5576ae39eaee c_dE0 public default
       
   119   |/
       
   120   o  4:c63e7dd93a91 c_dD0 public default
       
   121   |
       
   122   o  3:7d56a56d2547 c_dC0 public default
       
   123   |
       
   124   o  2:286d02a6e2a2 c_dB0 public default
       
   125   |
       
   126   o  1:134bc3852ad2 c_dA0 public default
       
   127   |
       
   128   o  0:ea207398892e ROOT public default
       
   129   
       
   130   $ hg push --publish
       
   131   pushing to $TESTTMP/bare-branch-server
       
   132   searching for changes
       
   133   no changes found
       
   134   [1]
       
   135   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
   136   @  7:d293f74a1233 c_oG0 public other
       
   137   |
       
   138   o  6:45b23c834b6a c_oF0 public other
       
   139   |
       
   140   | o  5:5576ae39eaee c_dE0 public default
       
   141   |/
       
   142   o  4:c63e7dd93a91 c_dD0 public default
       
   143   |
       
   144   o  3:7d56a56d2547 c_dC0 public default
       
   145   |
       
   146   o  2:286d02a6e2a2 c_dB0 public default
       
   147   |
       
   148   o  1:134bc3852ad2 c_dA0 public default
       
   149   |
       
   150   o  0:ea207398892e ROOT public default
       
   151   
       
   152 
       
   153 Selectively publishing 1 changeset
       
   154 ----------------------------------
       
   155 
       
   156   $ mkcommit c_oH0
       
   157   $ hg update default
       
   158   1 files updated, 0 files merged, 3 files removed, 0 files unresolved
       
   159   $ mkcommit c_dI0
       
   160   $ hg push -r default --publish
       
   161   pushing to $TESTTMP/bare-branch-server
       
   162   searching for changes
       
   163   adding changesets
       
   164   adding manifests
       
   165   adding file changes
       
   166   added 1 changesets with 1 changes to 1 files
       
   167   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
   168   @  9:fbf2be276221 c_dI0 public default
       
   169   |
       
   170   o  5:5576ae39eaee c_dE0 public default
       
   171   |
       
   172   | o  8:8e85646c135f c_oH0 draft other
       
   173   | |
       
   174   | o  7:d293f74a1233 c_oG0 public other
       
   175   | |
       
   176   | o  6:45b23c834b6a c_oF0 public other
       
   177   |/
       
   178   o  4:c63e7dd93a91 c_dD0 public default
       
   179   |
       
   180   o  3:7d56a56d2547 c_dC0 public default
       
   181   |
       
   182   o  2:286d02a6e2a2 c_dB0 public default
       
   183   |
       
   184   o  1:134bc3852ad2 c_dA0 public default
       
   185   |
       
   186   o  0:ea207398892e ROOT public default
       
   187   
       
   188 
       
   189 Selectively publishing 1 common changeset
       
   190 -----------------------------------------
       
   191 
       
   192   $ mkcommit c_dJ0
       
   193   $ hg push
       
   194   pushing to $TESTTMP/bare-branch-server
       
   195   searching for changes
       
   196   adding changesets
       
   197   adding manifests
       
   198   adding file changes
       
   199   added 2 changesets with 2 changes to 2 files
       
   200   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
   201   @  10:ac4cf59f2aac c_dJ0 draft default
       
   202   |
       
   203   o  9:fbf2be276221 c_dI0 public default
       
   204   |
       
   205   o  5:5576ae39eaee c_dE0 public default
       
   206   |
       
   207   | o  8:8e85646c135f c_oH0 draft other
       
   208   | |
       
   209   | o  7:d293f74a1233 c_oG0 public other
       
   210   | |
       
   211   | o  6:45b23c834b6a c_oF0 public other
       
   212   |/
       
   213   o  4:c63e7dd93a91 c_dD0 public default
       
   214   |
       
   215   o  3:7d56a56d2547 c_dC0 public default
       
   216   |
       
   217   o  2:286d02a6e2a2 c_dB0 public default
       
   218   |
       
   219   o  1:134bc3852ad2 c_dA0 public default
       
   220   |
       
   221   o  0:ea207398892e ROOT public default
       
   222   
       
   223   $ hg push --rev default --publish
       
   224   pushing to $TESTTMP/bare-branch-server
       
   225   searching for changes
       
   226   no changes found
       
   227   [1]
       
   228   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
   229   @  10:ac4cf59f2aac c_dJ0 public default
       
   230   |
       
   231   o  9:fbf2be276221 c_dI0 public default
       
   232   |
       
   233   o  5:5576ae39eaee c_dE0 public default
       
   234   |
       
   235   | o  8:8e85646c135f c_oH0 draft other
       
   236   | |
       
   237   | o  7:d293f74a1233 c_oG0 public other
       
   238   | |
       
   239   | o  6:45b23c834b6a c_oF0 public other
       
   240   |/
       
   241   o  4:c63e7dd93a91 c_dD0 public default
       
   242   |
       
   243   o  3:7d56a56d2547 c_dC0 public default
       
   244   |
       
   245   o  2:286d02a6e2a2 c_dB0 public default
       
   246   |
       
   247   o  1:134bc3852ad2 c_dA0 public default
       
   248   |
       
   249   o  0:ea207398892e ROOT public default
       
   250   
       
   251 
       
   252 Selectively publishing no changeset
       
   253 -----------------------------------
       
   254 
       
   255   $ hg push --rev default --publish
       
   256   pushing to $TESTTMP/bare-branch-server
       
   257   searching for changes
       
   258   no changes found
       
   259   [1]
       
   260   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
   261   @  10:ac4cf59f2aac c_dJ0 public default
       
   262   |
       
   263   o  9:fbf2be276221 c_dI0 public default
       
   264   |
       
   265   o  5:5576ae39eaee c_dE0 public default
       
   266   |
       
   267   | o  8:8e85646c135f c_oH0 draft other
       
   268   | |
       
   269   | o  7:d293f74a1233 c_oG0 public other
       
   270   | |
       
   271   | o  6:45b23c834b6a c_oF0 public other
       
   272   |/
       
   273   o  4:c63e7dd93a91 c_dD0 public default
       
   274   |
       
   275   o  3:7d56a56d2547 c_dC0 public default
       
   276   |
       
   277   o  2:286d02a6e2a2 c_dB0 public default
       
   278   |
       
   279   o  1:134bc3852ad2 c_dA0 public default
       
   280   |
       
   281   o  0:ea207398892e ROOT public default
       
   282   
       
   283 
       
   284 Testing --publish interaction with multiple head detection
       
   285 ============================================================
       
   286 
       
   287 pushing a topic changeset, publishing it
       
   288 ----------------------------------------
       
   289 
       
   290   $ hg topic topic_A
       
   291   marked working directory as topic: topic_A
       
   292   $ mkcommit c_dK0
       
   293   active topic 'topic_A' grew its first changeset
       
   294   $ hg push -r 'desc("c_dK0")' --publish
       
   295   pushing to $TESTTMP/bare-branch-server
       
   296   searching for changes
       
   297   adding changesets
       
   298   adding manifests
       
   299   adding file changes
       
   300   added 1 changesets with 1 changes to 1 files
       
   301   active topic 'topic_A' is now empty
       
   302   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
   303   @  11:d06fc4f891e8 c_dK0 public default
       
   304   |
       
   305   o  10:ac4cf59f2aac c_dJ0 public default
       
   306   |
       
   307   o  9:fbf2be276221 c_dI0 public default
       
   308   |
       
   309   o  5:5576ae39eaee c_dE0 public default
       
   310   |
       
   311   | o  8:8e85646c135f c_oH0 draft other
       
   312   | |
       
   313   | o  7:d293f74a1233 c_oG0 public other
       
   314   | |
       
   315   | o  6:45b23c834b6a c_oF0 public other
       
   316   |/
       
   317   o  4:c63e7dd93a91 c_dD0 public default
       
   318   |
       
   319   o  3:7d56a56d2547 c_dC0 public default
       
   320   |
       
   321   o  2:286d02a6e2a2 c_dB0 public default
       
   322   |
       
   323   o  1:134bc3852ad2 c_dA0 public default
       
   324   |
       
   325   o  0:ea207398892e ROOT public default
       
   326   
       
   327 
       
   328 pushing a new branch, alongside an existing topic
       
   329 -------------------------------------------------
       
   330 
       
   331   $ hg topic topic_A
       
   332   $ mkcommit c_dL0
       
   333   active topic 'topic_A' grew its first changeset
       
   334   $ hg push -r 'desc("c_dL0")'
       
   335   pushing to $TESTTMP/bare-branch-server
       
   336   searching for changes
       
   337   adding changesets
       
   338   adding manifests
       
   339   adding file changes
       
   340   added 1 changesets with 1 changes to 1 files
       
   341   $ hg update 'desc("c_dK")'
       
   342   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   343   $ mkcommit c_dM0
       
   344   $ hg push -r 'desc("c_dM0")' --publish
       
   345   pushing to $TESTTMP/bare-branch-server
       
   346   searching for changes
       
   347   adding changesets
       
   348   adding manifests
       
   349   adding file changes
       
   350   added 1 changesets with 1 changes to 1 files (+1 heads)
       
   351   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
   352   @  13:0d144c8b6c8f c_dM0 public default
       
   353   |
       
   354   | o  12:3c73f6cabf07 c_dL0 draft default topic_A
       
   355   |/
       
   356   o  11:d06fc4f891e8 c_dK0 public default
       
   357   |
       
   358   o  10:ac4cf59f2aac c_dJ0 public default
       
   359   |
       
   360   o  9:fbf2be276221 c_dI0 public default
       
   361   |
       
   362   o  5:5576ae39eaee c_dE0 public default
       
   363   |
       
   364   | o  8:8e85646c135f c_oH0 draft other
       
   365   | |
       
   366   | o  7:d293f74a1233 c_oG0 public other
       
   367   | |
       
   368   | o  6:45b23c834b6a c_oF0 public other
       
   369   |/
       
   370   o  4:c63e7dd93a91 c_dD0 public default
       
   371   |
       
   372   o  3:7d56a56d2547 c_dC0 public default
       
   373   |
       
   374   o  2:286d02a6e2a2 c_dB0 public default
       
   375   |
       
   376   o  1:134bc3852ad2 c_dA0 public default
       
   377   |
       
   378   o  0:ea207398892e ROOT public default
       
   379   
       
   380 
       
   381 pushing a topic (publishing) alongside and existing branch head
       
   382 ---------------------------------------------------------------
       
   383 
       
   384   $ hg update 'desc("c_dK")'
       
   385   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   386   $ hg topic topic_B
       
   387   marked working directory as topic: topic_B
       
   388   $ mkcommit c_dN0
       
   389   active topic 'topic_B' grew its first changeset
       
   390   $ hg push -r 'desc("c_dN0")' --publish
       
   391   pushing to $TESTTMP/bare-branch-server
       
   392   searching for changes
       
   393   abort: push creates new remote head 4dcd0be9db96!
       
   394   (merge or see 'hg help push' for details about pushing new heads)
       
   395   [255]
       
   396   $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}'
       
   397   @  14:4dcd0be9db96 c_dN0 draft default topic_B
       
   398   |
       
   399   | o  13:0d144c8b6c8f c_dM0 public default
       
   400   |/
       
   401   | o  12:3c73f6cabf07 c_dL0 draft default topic_A
       
   402   |/
       
   403   o  11:d06fc4f891e8 c_dK0 public default
       
   404   |
       
   405   o  10:ac4cf59f2aac c_dJ0 public default
       
   406   |
       
   407   o  9:fbf2be276221 c_dI0 public default
       
   408   |
       
   409   o  5:5576ae39eaee c_dE0 public default
       
   410   |
       
   411   | o  8:8e85646c135f c_oH0 draft other
       
   412   | |
       
   413   | o  7:d293f74a1233 c_oG0 public other
       
   414   | |
       
   415   | o  6:45b23c834b6a c_oF0 public other
       
   416   |/
       
   417   o  4:c63e7dd93a91 c_dD0 public default
       
   418   |
       
   419   o  3:7d56a56d2547 c_dC0 public default
       
   420   |
       
   421   o  2:286d02a6e2a2 c_dB0 public default
       
   422   |
       
   423   o  1:134bc3852ad2 c_dA0 public default
       
   424   |
       
   425   o  0:ea207398892e ROOT public default
       
   426