diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -881,6 +881,10 @@ class hgsubrepo(abstractsubrepo): @annotatesubrepoerror def incoming(self, ui, source, opts): + if 'rev' in opts or 'branch' in opts: + opts = copy.copy(opts) + opts.pop('rev', None) + opts.pop('branch', None) return hg.incoming(ui, self._repo, _abssource(self._repo, False), opts) @annotatesubrepoerror diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t --- a/tests/test-subrepo.t +++ b/tests/test-subrepo.t @@ -689,6 +689,24 @@ pull should pull t + $ hg incoming -S -r `hg log -r tip -T "{node|short}"` + comparing with $TESTTMP/t (glob) + no changes found + comparing with $TESTTMP/t/s + searching for changes + no changes found + comparing with $TESTTMP/t/s/ss + searching for changes + no changes found + comparing with $TESTTMP/t/t + searching for changes + changeset: 5:52c0adc0515a + tag: tip + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: 13 + + $ hg up pulling subrepo t from $TESTTMP/t/t searching for changes