changeset 2822:4f7abf341cd4

fetch: fix breakage from mpm. add test so will not break again.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Tue, 08 Aug 2006 16:09:26 -0700
parents 2e4ace008c94
children e0caea53c997
files hgext/fetch.py mercurial/hg.py tests/test-fetch tests/test-fetch.out
diffstat 4 files changed, 56 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/fetch.py	Tue Aug 08 21:42:50 2006 -0700
+++ b/hgext/fetch.py	Tue Aug 08 16:09:26 2006 -0700
@@ -36,7 +36,7 @@
         if newheads:
             ui.status(_('merging with new head %d:%s\n') %
                       (repo.changelog.rev(newheads[0]), short(newheads[0])))
-            err = repo.update(newheads[0], allow=True, remind=False)
+            err = hg.update(repo, newheads[0], allow=True, remind=False)
         if not err and len(newheads) > 1:
             ui.status(_('not merging with %d other new heads '
                         '(use "hg heads" and "hg merge" to merge them)') %
--- a/mercurial/hg.py	Tue Aug 08 21:42:50 2006 -0700
+++ b/mercurial/hg.py	Tue Aug 08 16:09:26 2006 -0700
@@ -211,9 +211,10 @@
 # update/merge/revert
 
 def update(repo, node, allow=False, force=False, choose=None,
-           moddirstate=True, forcemerge=False, wlock=None, show_stats=True):
+           moddirstate=True, forcemerge=False, wlock=None, show_stats=True,
+           remind=True):
     return merge.update(repo, node, allow, force, choose, moddirstate,
-                        forcemerge, wlock, show_stats)
+                        forcemerge, wlock, show_stats, remind)
 
 def verify(repo):
     """verify the consistency of a repository"""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-fetch	Tue Aug 08 16:09:26 2006 -0700
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+HGRCPATH=$HGTMP/.hgrc; export HGRCPATH
+echo "[extensions]" >> $HGTMP/.hgrc
+echo "fetch=" >> $HGTMP/.hgrc
+
+hg init a
+echo a > a/a
+hg --cwd a commit -d '1 0' -Ama
+
+hg clone a b
+hg clone a c
+
+echo b > a/b
+hg --cwd a commit -d '2 0' -Amb
+hg --cwd a parents -q
+
+echo % should pull one change
+hg --cwd b fetch ../a
+hg --cwd b parents -q
+
+echo c > c/c
+hg --cwd c commit -d '3 0' -Amc
+hg --cwd c fetch ../a
+ls c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-fetch.out	Tue Aug 08 16:09:26 2006 -0700
@@ -0,0 +1,27 @@
+adding a
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+adding b
+1:97d72e5f12c7
+% should pull one change
+pulling from ../a
+searching for changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+1:97d72e5f12c7
+adding c
+pulling from ../a
+searching for changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files (+1 heads)
+merging with new head 2:97d72e5f12c7
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+new changeset 3:5202af1888fa merges remote changes with local
+a
+b
+c