share: drop 'relshared' requirement as well
authorYuya Nishihara <yuya@tcha.org>
Fri, 03 Mar 2017 00:11:51 +0900
changeset 31222 344121b30f32
parent 31221 ecbd378d9a7e
child 31223 9f169b7f53d5
share: drop 'relshared' requirement as well
hgext/share.py
tests/test-share.t
--- 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