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

login
register
mail settings
Submitter Augie Fackler
Date Nov. 10, 2017, 11:11 p.m.
Message ID <00F12344-D07B-42A4-9E34-9FE81416844A@durin42.com>
Download mbox | patch
Permalink /patch/25473/
State Deferred
Headers show

Comments

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

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



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

>> Hollis Blanchard <hollis_blanchard@mentor.com> <mailto:hollis_blanchard@mentor.com>
>> Mentor Graphics Emulation Division
>> On 11/03/2017 02:07 PM, Hollis Blanchard wrote:
>>> # HG changeset patch
>>> # User Hollis Blanchard <hollis_blanchard@mentor.com> <mailto:hollis_blanchard@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@mercurial-scm.org <mailto:Mercurial-devel@mercurial-scm.org>
>>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel <https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel>
>> 
>
Hollis Blanchard - Nov. 30, 2017, 9:17 p.m.
On 11/10/2017 03:11 PM, Augie Fackler wrote:
>
>> On Nov 10, 2017, at 18:06, Augie Fackler <raf@durin42.com 
>> <mailto:raf@durin42.com>> wrote:
>>
>>
>>> On Nov 10, 2017, at 12:21, Hollis Blanchard 
>>> <hollis_blanchard@mentor.com <mailto:hollis_blanchard@mentor.com>> 
>>> wrote:
>>>
>>> Any additional comments?
>>
>> Hearing nothing else from anyone, I've queued this.
>
> Actually, this fails tests pretty badly, dropping it. Failures:
>

Hi Augie, sorry about the test failures. Since it's quick for you to 
detect failures, could you send that list to me and I'll investigate each?

Hollis Blanchard <hollis_blanchard@mentor.com>
Mentor Graphics Emulation Division
Augie Fackler - Dec. 4, 2017, 10:36 p.m.
> On Nov 30, 2017, at 16:17, Hollis Blanchard <hollis_blanchard@mentor.com> wrote:
> 
> On 11/10/2017 03:11 PM, Augie Fackler wrote:
>> 
>>> On Nov 10, 2017, at 18:06, Augie Fackler <raf@durin42.com <mailto:raf@durin42.com>> wrote:
>>> 
>>> 
>>>> On Nov 10, 2017, at 12:21, Hollis Blanchard <hollis_blanchard@mentor.com <mailto:hollis_blanchard@mentor.com>> wrote:
>>>> 
>>>> Any additional comments?
>>> 
>>> Hearing nothing else from anyone, I've queued this.
>> 
>> Actually, this fails tests pretty badly, dropping it. Failures:
>> 
> 
> Hi Augie, sorry about the test failures. Since it's quick for you to detect failures, could you send that list to me and I'll investigate each?

Failed test-url-rev.t: output changed
Failed test-histedit-outgoing.t: output changed
Failed test-revset-outgoing.t: output changed
Failed test-branch-option.t: output changed
Failed test-check-code.t: output changed

So just look at those 5 tests :) Let me know if you need help.

Thanks!

> Hollis Blanchard <hollis_blanchard@mentor.com> <mailto:hollis_blanchard@mentor.com>
> Mentor Graphics Emulation Division

Patch

--- /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")'