Patchwork D3060: tests: disallow using simple store repo with bundlerepo

login
register
mail settings
Submitter phabricator
Date April 4, 2018, 1:57 a.m.
Message ID <differential-rev-PHID-DREV-r24icbjz6gnh3inp2dbq-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30237/
State Superseded
Headers show

Comments

phabricator - April 4, 2018, 1:57 a.m.
indygreg created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  bundlerepo is... going to be difficult to port to an alternate
  store because it assumes revlogs for storage and essentially
  overlays the contents of a bundle onto a fake revlog-like
  primitive. It will be a good test case for our eventual new
  storage interface.
  
  Refactoring bundlerepo to make it work with non-revlog storage is
  going to be a bit of work. So for now, let's refuse to use the
  simple store repo when a bundlerepo is in play.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3060

AFFECTED FILES
  tests/simplestorerepo.py
  tests/test-manifest.t
  tests/test-mq-pull-from-bundle.t
  tests/test-narrow-strip.t
  tests/test-obsolete.t
  tests/test-shelve.t
  tests/test-treemanifest.t

CHANGE DETAILS




To: indygreg, durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t
--- a/tests/test-treemanifest.t
+++ b/tests/test-treemanifest.t
@@ -325,6 +325,8 @@ 
      rev linkrev nodeid       p1           p2
        0       4 064927a0648a 000000000000 000000000000
        1       5 25ecb8cb8618 000000000000 000000000000
+
+#if no-reposimplestore
   $ hg incoming .hg/strip-backup/*
   comparing with .hg/strip-backup/*-backup.hg (glob)
   searching for changes
@@ -334,6 +336,8 @@ 
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     modify dir1/a
   
+#endif
+
   $ hg unbundle .hg/strip-backup/*
   adding changesets
   adding manifests
diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -771,10 +771,12 @@ 
   $ hg shelve
   shelved as default
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+#if no-reposimplestore
   $ hg log -G --template '{rev}  {desc|firstline}  {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()'
   o  4  changes to: commit stuff  shelve@localhost
   |
   ~
+#endif
   $ hg log -G --template '{rev}  {desc|firstline}  {author}'
   @  3  commit stuff  test
   |
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -1244,6 +1244,7 @@ 
   o  0:4b34ecfb0d56 (draft) [ ] A
   
 
+#if no-reposimplestore
   $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg
   comparing with ../repo-bundleoverlay
   searching for changes
@@ -1256,6 +1257,7 @@ 
   |/
   o  0:4b34ecfb0d56 (draft) [ ] A
   
+#endif
 
 #if serve
 
diff --git a/tests/test-narrow-strip.t b/tests/test-narrow-strip.t
--- a/tests/test-narrow-strip.t
+++ b/tests/test-narrow-strip.t
@@ -128,6 +128,8 @@ 
   $ hg strip 0
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob)
+
+#if no-reposimplestore
   $ hg incoming .hg/strip-backup/*-backup.hg
   comparing with .hg/strip-backup/*-backup.hg (glob)
   changeset:   0:* (glob)
@@ -150,6 +152,8 @@ 
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     modify inside
   
+#endif
+
   $ hg unbundle .hg/strip-backup/*-backup.hg
   adding changesets
   adding manifests
diff --git a/tests/test-mq-pull-from-bundle.t b/tests/test-mq-pull-from-bundle.t
--- a/tests/test-mq-pull-from-bundle.t
+++ b/tests/test-mq-pull-from-bundle.t
@@ -1,3 +1,5 @@ 
+#require no-reposimplestore
+
   $ cat <<EOF >> $HGRCPATH
   > [extensions]
   > mq=
diff --git a/tests/test-manifest.t b/tests/test-manifest.t
--- a/tests/test-manifest.t
+++ b/tests/test-manifest.t
@@ -1,3 +1,5 @@ 
+#require no-reposimplestore
+
 Source bundle was generated with the following script:
 
 # hg init
diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py
--- a/tests/simplestorerepo.py
+++ b/tests/simplestorerepo.py
@@ -24,6 +24,7 @@ 
 )
 from mercurial import (
     ancestor,
+    bundlerepo,
     error,
     filelog,
     mdiff,
@@ -587,6 +588,9 @@ 
     if not repo.local():
         return
 
+    if isinstance(repo, bundlerepo.bundlerepository):
+        raise error.Abort(_('cannot use simple store with bundlerepo'))
+
     class simplestorerepo(repo.__class__):
         def file(self, f):
             return filestorage(self.svfs, f)