Patchwork [1,of,2,STABLE] discovery: outgoing pass unfiltered repo to findcommonincoming (issue3776)

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 28, 2013, 12:57 p.m.
Message ID <a3d0d55670f5f689bfa9.1359377829@crater2.logilab.fr>
Download mbox | patch
Permalink /patch/750/
State Accepted
Commit fe67107094fd6f827c55d77e35f652313730f68d
Delegated to: Kevin Bullock
Headers show

Comments

Pierre-Yves David - Jan. 28, 2013, 12:57 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# 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.

Patch

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