changeset 31222:344121b30f32

share: drop 'relshared' requirement as well
author Yuya Nishihara <yuya@tcha.org>
date Fri, 03 Mar 2017 00:11:51 +0900
parents ecbd378d9a7e
children 9f169b7f53d5
files hgext/share.py tests/test-share.t
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/share.py	Fri Mar 03 00:11:18 2017 +0900
+++ b/hgext/share.py	Fri Mar 03 00:11:51 2017 +0900
@@ -117,6 +117,7 @@
         util.rename(sharefile, sharefile + '.old')
 
         repo.requirements.discard('shared')
+        repo.requirements.discard('relshared')
         repo._writerequirements()
     finally:
         destlock and destlock.release()
--- a/tests/test-share.t	Fri Mar 03 00:11:18 2017 +0900
+++ b/tests/test-share.t	Fri Mar 03 00:11:51 2017 +0900
@@ -393,6 +393,21 @@
   [255]
   $ hg -R thatdir/rel root
   $TESTTMP/thatdir/rel
+
+test unshare relshared repo
+
+  $ cd thatdir/rel
+  $ hg unshare
+  $ test -d .hg/store
+  $ test -f .hg/sharedpath
+  [1]
+  $ grep shared .hg/requires
+  [1]
+  $ hg unshare
+  abort: this is not a shared repo
+  [255]
+  $ cd ../..
+
   $ rm -r thatdir
 
 Explicitly kill daemons to let the test exit on Windows