Patchwork D2007: narrowrepo: make repo requirement include the string 'experimental'

login
register
mail settings
Submitter phabricator
Date Feb. 2, 2018, 3:53 p.m.
Message ID <differential-rev-PHID-DREV-4faxrqttiiylgj6fcpyf-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27234/
State Superseded
Headers show

Comments

phabricator - Feb. 2, 2018, 3:53 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We can just move to "narrow" or similar when we finalize the
  format. I'm not sure what the migration process from one requirement
  to another should look like, but we're about to cross that bridge at
  Google once this change lands, so hopefully we'll know soon.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowrepo.py
  tests/test-narrow-acl.t
  tests/test-narrow-clone-no-ellipsis.t
  tests/test-narrow-clone.t
  tests/test-narrow-debugcommands.t
  tests/test-narrow-pull.t

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 2, 2018, 6:25 p.m.
indygreg added a comment.


  We can treat two requirements strings as equivalent.
  
  The trick is once we introduce a requirements string in the wild, we can't make BC changes to its format. i.e. the behavior surrounding a store requirement must be immutable over time. So e.g. if we introduce `narrowhg-experimental` today, any repos with that requirement will be openable by any Mercurial supporting that requirement, even if we change the store format. That's not good. Especially if we ship `narrowhg-experimental` with different behavior in say 4.6 and 4.7.
  
  One trick I like to do (which I'll be doing with the wire protocol shortly), is introduce a version component. e.g. `experimental-narrow-0001`. If you make a change to the format, you bump to `experimental-narrow-0002`. This basically requires that a specific revision of Mercurial must be used for all operations. When we finally make the transition to non-experimental, you can optionally teach new clients to treat the latest experimental version as equivalent to the final version.

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers
Cc: indygreg, mercurial-devel
phabricator - Feb. 5, 2018, 9:25 p.m.
indygreg accepted this revision.
indygreg added inline comments.
This revision is now accepted and ready to land.

INLINE COMMENTS

> test-narrow-pull.t:169
>    $ hg unshare
> -  devel-warn: write with no wlock: "narrowspec" at: */hgext/narrow/narrowrepo.py:41 (unsharenarrowspec) (glob)
> +  devel-warn: write with no wlock: "narrowspec" at: */hgext/narrow/narrowrepo.py:43 (unsharenarrowspec) (glob)
>    $ hg verify

I'd glob the line number while you are here. Also, I think one of my many review comments will make this warning go away :)

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/tests/test-narrow-pull.t b/tests/test-narrow-pull.t
--- a/tests/test-narrow-pull.t
+++ b/tests/test-narrow-pull.t
@@ -166,7 +166,7 @@ 
 
 We should also be able to unshare without breaking everything:
   $ hg unshare
-  devel-warn: write with no wlock: "narrowspec" at: */hgext/narrow/narrowrepo.py:41 (unsharenarrowspec) (glob)
+  devel-warn: write with no wlock: "narrowspec" at: */hgext/narrow/narrowrepo.py:43 (unsharenarrowspec) (glob)
   $ hg verify
   checking changesets
   checking manifests
diff --git a/tests/test-narrow-debugcommands.t b/tests/test-narrow-debugcommands.t
--- a/tests/test-narrow-debugcommands.t
+++ b/tests/test-narrow-debugcommands.t
@@ -7,7 +7,7 @@ 
   > [excludes]
   > EOF
   $ echo treemanifest >> .hg/requires
-  $ echo narrowhg >> .hg/requires
+  $ echo narrowhg-experimental >> .hg/requires
   $ mkdir -p foo/bar
   $ echo b > foo/f
   $ echo c > foo/bar/f
diff --git a/tests/test-narrow-clone.t b/tests/test-narrow-clone.t
--- a/tests/test-narrow-clone.t
+++ b/tests/test-narrow-clone.t
@@ -29,7 +29,7 @@ 
   $ cat .hg/requires | grep -v generaldelta
   dotencode
   fncache
-  narrowhg
+  narrowhg-experimental
   revlogv1
   store
 
diff --git a/tests/test-narrow-clone-no-ellipsis.t b/tests/test-narrow-clone-no-ellipsis.t
--- a/tests/test-narrow-clone-no-ellipsis.t
+++ b/tests/test-narrow-clone-no-ellipsis.t
@@ -25,7 +25,7 @@ 
   $ cat .hg/requires | grep -v generaldelta
   dotencode
   fncache
-  narrowhg
+  narrowhg-experimental
   revlogv1
   store
 
diff --git a/tests/test-narrow-acl.t b/tests/test-narrow-acl.t
--- a/tests/test-narrow-acl.t
+++ b/tests/test-narrow-acl.t
@@ -34,7 +34,7 @@ 
 
 Requirements should contain narrowhg
   $ cat narrowclone1/.hg/requires | grep narrowhg
-  narrowhg
+  narrowhg-experimental
 
 NarrowHG should track f1 and f2
   $ hg -R narrowclone1 tracked
diff --git a/hgext/narrow/narrowrepo.py b/hgext/narrow/narrowrepo.py
--- a/hgext/narrow/narrowrepo.py
+++ b/hgext/narrow/narrowrepo.py
@@ -23,7 +23,9 @@ 
     narrowspec,
 )
 
-REQUIREMENT = 'narrowhg'
+# When narrowing is finalized and no longer subject to format changes,
+# we should move this to just "narrow" or similar.
+REQUIREMENT = 'narrowhg-experimental'
 
 def wrappostshare(orig, sourcerepo, destrepo, **kwargs):
     orig(sourcerepo, destrepo, **kwargs)