<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">You should be able to rephrase this to not need the code sample. Something like "The effect of updating to the parent of wctx is to move to the parent's branch; this means that it is no longer necessary to prevent you from updating if you would lose your newly created branch".</blockquote><div><br></div><div>You are right, I changed this in V8 </div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-11 21:16 GMT+02:00 Simon Farnsworth <span dir="ltr"><<a href="mailto:simonfar@fb.com" target="_blank">simonfar@fb.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On 11/04/2016 18:37, liscju wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
# HG changeset patch<br>
# User liscju <<a href="mailto:piotr.listkiewicz@gmail.com" target="_blank">piotr.listkiewicz@gmail.com</a>><br>
# Date 1459832013 -7200<br>
#      Tue Apr 05 06:53:33 2016 +0200<br>
# Node ID 9b92231d66d9e4f41dd36bfc5f34264d8a8e9113<br>
# Parent  c5565fc8848dd084d104ca40c33d1acdfcff8bc6<br>
update: fix bare update to work on new branch (BC)<br>
<br>
So far bare update on new branch results in<br>
'abort: branch new-branch not found'. This commit fixes<br>
this by updating to the parent of wctx.<br>
<br>
This commit deletes lines:<br>
<br>
        if currentbranch == 'default': # no default branch<br>
                # update to the tipmost non-closed branch head<br>
                 node = repo.revs('max(head() and not closed())').first()<br>
         else:<br>
                 raise error.Abort(_("branch %s not found") % currentbranch)<br>
<br>
</blockquote>
<br></span>
This chunk of commit message is unnecessary - I can see what you've deleted by looking at the diff.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
They are no longer necessary because when parent of wctx exists,<br>
then it updates to it. When it does not, it means that repo is<br>
newly created(has no changesets), so update should stay on null<br>
parent.<br>
</blockquote>
<br></span>
You should be able to rephrase this to not need the code sample. Something like "The effect of updating to the parent of wctx is to move to the parent's branch; this means that it is no longer necessary to prevent you from updating if you would lose your newly created branch".<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<br>
diff -r c5565fc8848d -r 9b92231d66d9 mercurial/destutil.py<br>
--- a/mercurial/destutil.py     Wed Apr 06 22:26:47 2016 -0400<br>
+++ b/mercurial/destutil.py     Tue Apr 05 06:53:33 2016 +0200<br>
@@ -102,11 +102,7 @@ def _destupdatebranch(repo, clean, check<br>
          if bookmarks.isactivewdirparent(repo):<br>
              movemark = repo['.'].node()<br>
      else:<br>
-        if currentbranch == 'default': # no default branch!<br>
-            # update to the tipmost non-closed branch head<br>
-            node = repo.revs('max(head() and not closed())').first()<br>
-        else:<br>
-            raise error.Abort(_("branch %s not found") % currentbranch)<br>
+        node = repo['.'].node()<br>
      return node, movemark, None<br>
<br>
  def _destupdatebranchfallback(repo, clean, check):<br>
diff -r c5565fc8848d -r 9b92231d66d9 tests/test-newbranch.t<br>
--- a/tests/test-newbranch.t    Wed Apr 06 22:26:47 2016 -0400<br>
+++ b/tests/test-newbranch.t    Tue Apr 05 06:53:33 2016 +0200<br>
@@ -211,8 +211,7 @@ Update with no arguments: tipmost revisi<br>
    marked working directory as branch foobar<br>
<br>
    $ hg up<br>
-  abort: branch foobar not found<br>
-  [255]<br>
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved<br>
<br>
  Fast-forward merge:<br>
<br>
@@ -345,3 +344,50 @@ 2 branch heads, implicit merge works:<br>
    (branch merge, don't forget to commit)<br>
<br>
    $ cd ..<br>
+<br>
+We expect that bare update on new branch, updates to parent<br>
+<br>
+  $ hg init bareupdateonnewbranch<br>
+  $ cd bareupdateonnewbranch<br>
+  $ hg update<br>
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved<br>
+  $ touch a<br>
+  $ hg commit -A -m "a"<br>
+  adding a<br>
+  $ touch b<br>
+  $ hg commit -A -m "b"<br>
+  adding b<br>
+  $ touch c<br>
+  $ hg commit -A -m "c"<br>
+  adding c<br>
+  $ hg update -r 1<br>
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved<br>
+  $ hg log -G<br>
+  o  changeset:   2:991a3460af53<br>
+  |  tag:         tip<br>
+  |  user:        test<br>
+  |  date:        Thu Jan 01 00:00:00 1970 +0000<br>
+  |  summary:     c<br>
+  |<br>
+  @  changeset:   1:0e067c57feba<br>
+  |  user:        test<br>
+  |  date:        Thu Jan 01 00:00:00 1970 +0000<br>
+  |  summary:     b<br>
+  |<br>
+  o  changeset:   0:3903775176ed<br>
+     user:        test<br>
+     date:        Thu Jan 01 00:00:00 1970 +0000<br>
+     summary:     a<br>
+<br>
+  $ hg branch dev<br>
+  marked working directory as branch dev<br>
+  (branches are permanent and global, did you want a bookmark?)<br>
+  $ hg update<br>
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved<br>
+  $ hg summary<br>
+  parent: 1:0e067c57feba<br>
+   b<br>
+  branch: dev<br>
+  commit: (new branch)<br>
+  update: (current)<br>
+  phases: 3 draft<br></div></div>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org" target="_blank">Mercurial-devel@mercurial-scm.org</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=CwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=mEgSWILcY4c4W3zjApBQLA&m=7AfD_mdb3FuBU5-UM7F2cqjFL9oI9SsbrCrOvESHEMY&s=u8hq0WrtboYcBLt-rdRSx3IUS6ZQn8X0qByGFMQIJOQ&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=CwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=mEgSWILcY4c4W3zjApBQLA&m=7AfD_mdb3FuBU5-UM7F2cqjFL9oI9SsbrCrOvESHEMY&s=u8hq0WrtboYcBLt-rdRSx3IUS6ZQn8X0qByGFMQIJOQ&e=</a><br>
<br><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
Simon Farnsworth<br>
</font></span></blockquote></div><br></div>