From patchwork Mon Jan 28 12:57:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1, of, 2, STABLE] discovery: outgoing pass unfiltered repo to findcommonincoming (issue3776) From: Pierre-Yves David X-Patchwork-Id: 750 Message-Id: To: mercurial-devel@selenic.com Cc: pierre-yves.david@logilab.fr Date: Mon, 28 Jan 2013 13:57:09 +0100 # HG changeset patch # User Pierre-Yves David # Date 1359377771 -3600 # Branch stable # Node ID a3d0d55670f5f689bfa91c83604c872b6b2eba28 # Parent 692cbda1eb50fe30c70792cb1e9380b28769467c discovery: outgoing pass unfiltered repo to findcommonincoming (issue3776) We noa pass an unfiltered repo in the same way `localrepo.push` does. This does not alter outgoing behavior and prevents possible crash with computing common/missing. The `findcommonincoming` code could be simplified to make this unnecessary, but this is too much change for the freeze. diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -556,11 +556,11 @@ def _outgoing(ui, repo, dest, opts): revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev')) if revs: revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)] other = peer(repo, opts, dest) - outgoing = discovery.findcommonoutgoing(repo, other, revs, + outgoing = discovery.findcommonoutgoing(repo.unfiltered(), other, revs, force=opts.get('force')) o = outgoing.missing if not o: scmutil.nochangesfound(repo.ui, repo, outgoing.excluded) return None diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -316,15 +316,42 @@ Exchange Test ============================ Destination repo does not have any data --------------------------------------- +Simple incoming test + + $ hg init tmpc + $ cd tmpc + $ hg incoming ../tmpb + comparing with ../tmpb + changeset: 0:1f0dee641bb7 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: add a + + changeset: 1:7c3bad9141dc + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: add b + + changeset: 2:245bde4270cd + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: add original_c + + changeset: 6:6f9641995072 + tag: tip + parent: 1:7c3bad9141dc + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: add n3w_3_c + + Try to pull markers (extinct changeset are excluded but marker are pushed) - $ hg init tmpc - $ cd tmpc $ hg pull ../tmpb pulling from ../tmpb requesting all changes adding changesets adding manifests @@ -661,10 +688,20 @@ Do not warn about new head when the new $ hg up -q 'desc(n3w_3_c)' $ mkcommit obsolete_e created new head $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'` + $ hg outgoing ../tmpf # parasite hg outgoing testin + comparing with ../tmpf + searching for changes + changeset: 6:3de5eca88c00 + tag: tip + parent: 3:6f9641995072 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: add obsolete_e + $ hg push ../tmpf pushing to ../tmpf searching for changes adding changesets adding manifests