[PATCH] [v2] outgoing: respect ":pushurl" paths (issue5365)

Augie Fackler raf at durin42.com
Fri Nov 10 18:11:58 EST 2017


> On Nov 10, 2017, at 18:06, Augie Fackler <raf at durin42.com> wrote:
> 
> 
>> On Nov 10, 2017, at 12:21, Hollis Blanchard <hollis_blanchard at mentor.com <mailto:hollis_blanchard at mentor.com>> wrote:
>> 
>> Any additional comments?
> 
> Hearing nothing else from anyone, I've queued this.

Actually, this fails tests pretty badly, dropping it. Failures:

--- /home/augie/hg/tests/test-url-rev.t
+++ /home/augie/hg/tests/test-url-rev.t.err
@@ -106,6 +106,7 @@
   remote: 2 outgoing
   $ hg -q outgoing '../clone#foo'
   2:faba9097cad4
+  3:4cd725637392
   $ hg summary --remote --config paths.default='../clone#foo'
   parent: 3:4cd725637392 tip
    add bar
@@ -308,6 +309,8 @@

   $ hg clone -q -r 0 . ../another
   $ hg -q outgoing '../another#default'
+  1:cd2a86ecc814
+  2:faba9097cad4
   3:4cd725637392
   4:d515801a8f3d


ERROR: test-url-rev.t output changed

--- /home/augie/hg/tests/test-histedit-outgoing.t
+++ /home/augie/hg/tests/test-histedit-outgoing.t.err
@@ -142,6 +142,8 @@
   $ hg -q outgoing -G --template '{node|short}({branch})' '../r#default'
   @  3879dc049647(default)

+  o  f26599ee3441(foo)
+
   o  652413bf663e(default)
   |
   o  e860deea161a(default)

--- /home/augie/hg/tests/test-revset-outgoing.t
+++ /home/augie/hg/tests/test-revset-outgoing.t.err
@@ -73,6 +73,7 @@
   comparing with $TESTTMP/a (glob)
   searching for changes
   2:1d4099801a4e: '3' stable
+  3:f0461977a3db: '4'

   $ hg tlog -r 'outgoing()'
   2:1d4099801a4e: '3' stable
@@ -80,6 +81,7 @@
   $ hg tout ../a#default
   comparing with ../a
   searching for changes
+  2:1d4099801a4e: '3' stable
   3:f0461977a3db: '4'

   $ hg tlog -r 'outgoing("../a#default")'
@@ -105,8 +107,7 @@
   green = ../a#default

   $ hg tout green
-  comparing with green
-  abort: repository green not found!
+  abort: repository green does not exist!
   [255]

   $ hg tlog -r 'outgoing("green")'


etc. Could you take a look and send a v3? Thanks!

>> Hollis Blanchard <hollis_blanchard at mentor.com> <mailto:hollis_blanchard at mentor.com>
>> Mentor Graphics Emulation Division
>> On 11/03/2017 02:07 PM, Hollis Blanchard wrote:
>>> # HG changeset patch
>>> # User Hollis Blanchard <hollis_blanchard at mentor.com> <mailto:hollis_blanchard at mentor.com>
>>> # Date 1509731952 25200
>>> #      Fri Nov 03 10:59:12 2017 -0700
>>> # Branch stable
>>> # Node ID a952cae0303fa38d1b246561704071d41bbfa1ea
>>> # Parent  f445b10dc7fb3495d24d1c22b0996148864c77f7
>>> [v2] outgoing: respect ":pushurl" paths (issue5365)
>>> 
>>> Make 'hg outgoing' respect "paths.default:pushurl" in addition to
>>> "paths.default-push".
>>> 
>>> 'hg outgoing' has always meant "what will happen if I run 'hg push'?" and it's
>>> still documented that way:
>>> 
>>>     Show changesets not found in the specified destination repository or the
>>>     default push location. These are the changesets that would be pushed if a
>>>     push was requested.
>>> 
>>> If the user uses the now-deprecated "paths.default-push" path, it continues to
>>> work that way. However, as described at
>>> https://bz.mercurial-scm.org/show_bug.cgi?id=5365 <https://bz.mercurial-scm.org/show_bug.cgi?id=5365>, it doesn't behave the same
>>> with "paths.default:pushurl".
>>> 
>>> Why does it matter? Similar to the bugzilla reporter, I have a read-only mirror
>>> of a non-Mercurial repository:
>>> 
>>>   upstream -> imported mirror -> user clone
>>>          ^-----------------------/
>>> 
>>> Users push directly to upstream, and that content is then imported into the
>>> mirror. However, those repositories are not the same; it's possible that the
>>> mirroring has either broken completely, or an import process is running and not
>>> yet complete. In those cases, 'hg outgoing' will list changesets that have
>>> already been pushed.
>>> 
>>> Mozilla's desired behavior described in bug 5365 can be accomplished through
>>> other means (e.g. 'hg outgoing default'), preserving the consistency and
>>> meaning of 'hg outgoing'.
>>> 
>>> diff --git a/mercurial/hg.py b/mercurial/hg.py
>>> --- a/mercurial/hg.py
>>> +++ b/mercurial/hg.py
>>> @@ -910,7 +910,11 @@ def incoming(ui, repo, source, opts):
>>>      return _incoming(display, subreporecurse, ui, repo, source, opts)
>>>  
>>>  def _outgoing(ui, repo, dest, opts):
>>> -    dest = ui.expandpath(dest or 'default-push', dest or 'default')
>>> +    path = ui.paths.getpath(dest, default=('default-push', 'default'))
>>> +    if not path:
>>> +        raise error.Abort(_('default repository not configured!'),
>>> +                hint=_("see 'hg help config.paths'"))
>>> +    dest = path.pushloc or path.loc
>>>      dest, branches = parseurl(dest, opts.get('branch'))
>>>      ui.status(_('comparing with %s\n') % util.hidepassword(dest))
>>>      revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
>>> diff --git a/tests/test-incoming-outgoing.t b/tests/test-incoming-outgoing.t
>>> --- a/tests/test-incoming-outgoing.t
>>> +++ b/tests/test-incoming-outgoing.t
>>> @@ -491,3 +491,71 @@ incoming from empty remote repository
>>>    searching for changes
>>>    no changes found
>>>    [1]
>>> +
>>> +Create a "split" repo that pulls from r1 and pushes to r2, using default-push
>>> +
>>> +  $ hg clone r1 split
>>> +  updating to branch default
>>> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>>> +  $ ed -s split/.hg/hgrc << EOF
>>> +  > /^default
>>> +  > a
>>> +  > default-push = file://$TESTTMP/r2 <file://$testtmp/r2>
>>> +  > .
>>> +  > w
>>> +  > q
>>> +  > EOF
>>> +  default = $TESTTMP/r1
>>> +  $ hg -R split paths
>>> +  default = $TESTTMP/r1
>>> +  default-push = file://$TESTTMP/r2 <file://$testtmp/r2>
>>> +  $ hg -R split outgoing
>>> +  comparing with file://$TESTTMP/r2 <file://$testtmp/r2>
>>> +  searching for changes
>>> +  changeset:   0:3e92d79f743a
>>> +  tag:         tip
>>> +  user:        test
>>> +  date:        Thu Jan 01 00:00:00 1970 +0000
>>> +  summary:     a
>>> +  
>>> +
>>> +Use default:pushurl instead of default-push
>>> +
>>> +  $ ed -s split/.hg/hgrc <<EOF
>>> +  > /^default-push
>>> +  > c
>>> +  > default:pushurl = file://$PWD/r2 <file://$pwd/r2>
>>> +  > .
>>> +  > w
>>> +  > EOF
>>> +  default-push = file://$TESTTMP/r2 <file://$testtmp/r2>
>>> +  $ hg -R split paths
>>> +  default = $TESTTMP/r1
>>> +  default:pushurl = file://$TESTTMP/r2 <file://$testtmp/r2>
>>> +  $ hg -R split outgoing
>>> +  comparing with file://$TESTTMP/r2 <file://$testtmp/r2>
>>> +  searching for changes
>>> +  changeset:   0:3e92d79f743a
>>> +  tag:         tip
>>> +  user:        test
>>> +  date:        Thu Jan 01 00:00:00 1970 +0000
>>> +  summary:     a
>>> +  
>>> +
>>> +Push and then double-check outgoing
>>> +
>>> +  $ echo a >> split/foo
>>> +  $ hg -R split commit -Ama
>>> +  $ hg -R split push
>>> +  pushing to file://$TESTTMP/r2 <file://$testtmp/r2>
>>> +  searching for changes
>>> +  adding changesets
>>> +  adding manifests
>>> +  adding file changes
>>> +  added 2 changesets with 2 changes to 1 files
>>> +  $ hg -R split outgoing
>>> +  comparing with file://$TESTTMP/r2 <file://$testtmp/r2>
>>> +  searching for changes
>>> +  no changes found
>>> +  [1]
>>> +
>>> _______________________________________________
>>> Mercurial-devel mailing list
>>> Mercurial-devel at mercurial-scm.org <mailto:Mercurial-devel at mercurial-scm.org>
>>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel <https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel>
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20171110/39c64503/attachment.html>


More information about the Mercurial-devel mailing list