pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Recommending one debug command from another one sounds fine to me.
  
  Also documentation about share-safe in `hg help -e share -v` was lacking 
correct
  description on how upgrade existing shares. This fixes that and also start
  mentioning about debugsharesafe.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/share.py
  mercurial/upgrade.py
  tests/test-share-safe.t

CHANGE DETAILS

diff --git a/tests/test-share-safe.t b/tests/test-share-safe.t
--- a/tests/test-share-safe.t
+++ b/tests/test-share-safe.t
@@ -372,7 +372,8 @@
     - changelog
     - manifest
   
-  repository upgraded to share safe mode, existing shares will still work in 
old non-safe mode. Re-share existing shares to use them in safe mode New shares 
will be created in safe mode.
+  repository upgraded to share safe mode, existing shares will still work in 
old non-safe mode.
+  (Run `hg debugsharesafe --upgrade` in shares to  update them to use share 
safe mode.)
 
   $ hg debugrequirements
   dotencode
@@ -475,7 +476,8 @@
     - changelog
     - manifest
   
-  repository downgraded to not use share safe mode, existing shares will not 
work and needs to be reshared.
+  repository downgraded to not use share safe mode, existing shares will not 
work.
+  (Run `hg debugsharesafe --downgrade` in shares to downgrade them.)
 
   $ hg debugrequirements
   dotencode
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -309,16 +309,17 @@
                 ui.warn(
                     _(
                         b'repository upgraded to share safe mode, existing'
-                        b' shares will still work in old non-safe mode. '
-                        b'Re-share existing shares to use them in safe mode'
-                        b' New shares will be created in safe mode.\n'
+                        b' shares will still work in old non-safe mode.\n'
+                        b'(Run `hg debugsharesafe --upgrade` in shares to '
+                        b' update them to use share safe mode.)\n'
                     )
                 )
             if upgrade_actions.sharesafe.name in removedreqs:
                 ui.warn(
                     _(
                         b'repository downgraded to not use share safe mode, '
-                        b'existing shares will not work and needs to'
-                        b' be reshared.\n'
+                        b'existing shares will not work.\n(Run `hg '
+                        b'debugsharesafe --downgrade` in shares '
+                        b'to downgrade them.)\n'
                     )
                 )
diff --git a/hgext/share.py b/hgext/share.py
--- a/hgext/share.py
+++ b/hgext/share.py
@@ -59,10 +59,9 @@
     requirements. This only applies to shares which are done after enabling
     the config option.
 
-    For enabling this in existing shares, enable the config option and reshare.
-
-    For resharing existing shares, make sure your working directory is clean
-    and there are no untracked files, delete that share and create a new share.
+    For enabling this in existing shares, upgrade the shared-source using
+    `hg debugupgraderepo` and then upgrade shares using
+    `hg debugsharesafe --upgrade` command.
 '''
 
 from __future__ import absolute_import



To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to