[PATCH] hg: fix _incoming (broken by 72c84f24b420)

Yuya Nishihara yuya at tcha.org
Sun May 1 09:47:51 CDT 2011


Peter Arrenbrecht wrote:
> # HG changeset patch
> # User Peter Arrenbrecht <peter.arrenbrecht at gmail.com>
> # Date 1304260811 -7200
> # Node ID 04aee572fbf33712ab743bf023dffa66937f642c
> # Parent  72c84f24b420f152ca5cf2d4117de3091e6617e4
> hg: fix _incoming (broken by 72c84f24b420)
> 
> diff --git a/mercurial/hg.py b/mercurial/hg.py
> --- a/mercurial/hg.py
> +++ b/mercurial/hg.py
> @@ -433,7 +433,7 @@
>          return subreporecurse()
>  
>      try:
> -        chlist = other.changelog.findmissing(common, revs)
> +        chlist = other.changelog.findmissing(common + repo.heads(), revs)
>          displayer = cmdutil.show_changeset(ui, other, opts, buffered)
>  
>          # XXX once graphlog extension makes it into core,

Hi,
I'm just looking this issue.
Isn't it a bug of bundlerepo.getremotechanges() ?

Regards,

# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1304260158 -32400
# Node ID fe18fad9dcc169252c612051c1907c0b5f558d0a
# Parent  81e6d42b3228460543257e8e9d2f4cc46b6bfe5b
bundlerepo: recalculate common nodes if replacing other repo by bundlerepo

This fixes the issue 'hg incoming http://...' includes local changes since
7abab875e647.
Because bundlerepo includes whole history of local repo, common nodes between
'remote other' and 'local' can be different from nodes between 'bundle other'
and 'local'.

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -318,5 +318,7 @@ def getremotechanges(ui, repo, other, re
         if not other.local():
             # use the created uncompressed bundlerepo
             other = bundlerepository(ui, repo.root, fname)
+            # bundlerepo includes local history, so updating common nodes
+            common = repo.heads()
     return (other, common, incoming, bundle)
 
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
@@ -95,6 +95,25 @@ http incoming
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     4
   
+  $ hg clone -r7 test test2
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 8 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo 8a >> test2/foo
+  $ hg -R test2 commit -Am 8a -utest2
+  $ hg -R test2 incoming http://localhost:$HGPORT/
+  comparing with http://localhost:$HGPORT/
+  searching for changes
+  changeset:   9:e4feb4ac9035
+  tag:         tip
+  parent:      7:d152815bb8db
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     8
+  
 
 local incoming


More information about the Mercurial-devel mailing list