pull: allow to pull from bundle file without need for bundle: syntax
authorVadim Gelfer <vadim.gelfer@gmail.com>
Sun, 30 Jul 2006 21:46:38 -0700
changeset 2738 400a4a502001
parent 2737 a5c43944e1ee
child 2739 3248aa10b388
pull: allow to pull from bundle file without need for bundle: syntax
mercurial/hg.py
tests/test-bundle
tests/test-bundle.out
--- a/mercurial/hg.py	Sun Jul 30 09:37:08 2006 +0300
+++ b/mercurial/hg.py	Sun Jul 30 21:46:38 2006 -0700
@@ -31,6 +31,8 @@
 def local_(ui, path, create=0):
     if path.startswith('file:'):
         path = path[5:]
+    if not create and os.path.isfile(path):
+        return bundlerepo.bundlerepository(ui, '', path)
     return localrepo.localrepository(ui, path, create)
 
 def ssh_(ui, path, create=0):
--- a/tests/test-bundle	Sun Jul 30 09:37:08 2006 +0300
+++ b/tests/test-bundle	Sun Jul 30 21:46:38 2006 -0700
@@ -30,10 +30,14 @@
 hg init empty
 hg -R test bundle full.hg empty
 hg -R test unbundle full.hg
-hg -R empty unbundle full.hg
 hg -R empty heads
 hg -R empty verify
 
+hg --cwd test pull ../full.hg
+hg --cwd empty pull ../full.hg
+hg -R empty rollback
+hg --cwd empty pull ../full.hg
+
 rm -rf empty
 hg init empty
 cd empty
--- a/tests/test-bundle.out	Sun Jul 30 09:37:08 2006 +0300
+++ b/tests/test-bundle.out	Sun Jul 30 21:46:38 2006 -0700
@@ -11,28 +11,34 @@
 adding file changes
 added 0 changesets with 0 changes to 4 files
 (run 'hg update' to get a working copy)
+changeset:   -1:000000000000
+tag:         tip
+user:        
+date:        Thu Jan 01 00:00:00 1970 +0000
+
+checking changesets
+checking manifests
+crosschecking files in changesets and manifests
+checking files
+0 files, 0 changesets, 0 total revisions
+pulling from ../full.hg
+searching for changes
+no changes found
+pulling from ../full.hg
+requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 9 changesets with 7 changes to 4 files (+1 heads)
 (run 'hg heads' to see heads, 'hg merge' to merge)
-changeset:   8:836ac62537ab
-tag:         tip
-parent:      3:ac69c658229d
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     0.3m
-
-changeset:   7:80fe151401c2
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     1.3m
-
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
+rolling back last transaction
+pulling from ../full.hg
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 9 changesets with 7 changes to 4 files (+1 heads)
+(run 'hg heads' to see heads, 'hg merge' to merge)
 changeset:   8:836ac62537ab
 tag:         tip
 parent:      3:ac69c658229d