# HG changeset patch # User Matt Harbison # Date 2015-04-28 01:15:25 # Node ID 5135c2be69593c614c7821dd5ba83650d7729088 # Parent 89fe9921511f2fedbc6d4b0b9bf5fea974951561 subrepo: don't pass the outer repo's --rev or --branch to subrepo outgoing() The previous behavior didn't reflect what would actually be pushed- push will ignore --rev and --branch in the subrepo and push everything. Therefore, 'push -r {rev}' would not list everything, unless {rev} was also the revision of the subrepo's tip. Worse, if a hash was passed in, the command would abort because that hash would either not be in the outer repo or not in the subrepo. diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -873,6 +873,10 @@ class hgsubrepo(abstractsubrepo): @annotatesubrepoerror def outgoing(self, ui, dest, opts): + if 'rev' in opts or 'branch' in opts: + opts = copy.copy(opts) + opts.pop('rev', None) + opts.pop('branch', None) return hg.outgoing(ui, self._repo, _abssource(self._repo, True), opts) @annotatesubrepoerror diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t --- a/tests/test-subrepo.t +++ b/tests/test-subrepo.t @@ -598,6 +598,26 @@ committing into a subrepo makes its stor $ echo foo >> s/ss/a $ hg -R s/ss commit -m 'test dirty store detection' + + $ hg out -S -r `hg log -r tip -T "{node|short}"` + comparing with $TESTTMP/t (glob) + searching for changes + no changes found + comparing with $TESTTMP/t/s + searching for changes + no changes found + comparing with $TESTTMP/t/s/ss + searching for changes + changeset: 1:79ea5566a333 + tag: tip + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: test dirty store detection + + comparing with $TESTTMP/t/t + searching for changes + no changes found + $ hg push pushing to $TESTTMP/t (glob) pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)