D4789: narrow: check for servers' narrow support before doing anything (BC)

2018-10-02 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG06e75fbf9d6b: narrow: check for servers narrow 
support before doing anything (BC) (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4789?vs=11518=11569

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

AFFECTED FILES
  hgext/narrow/narrowcommands.py
  tests/test-narrow-clone-non-narrow-server.t
  tests/test-narrow-clone.t

CHANGE DETAILS

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
@@ -65,7 +65,7 @@
 
   $ hg clone --narrow master narrow-via-localpeer --noupdate --include 
"dir/src/f10"
   requesting all changes
-  abort: server doesn't support narrow clones
+  abort: server does not support narrow clones
   [255]
   $ hg tracked -R narrow-via-localpeer
   abort: repository narrow-via-localpeer not found!
diff --git a/tests/test-narrow-clone-non-narrow-server.t 
b/tests/test-narrow-clone-non-narrow-server.t
--- a/tests/test-narrow-clone-non-narrow-server.t
+++ b/tests/test-narrow-clone-non-narrow-server.t
@@ -39,7 +39,7 @@
 
   $ hg clone --narrow --include f1 http://localhost:$HGPORT1/ narrowclone
   requesting all changes
-  abort: server doesn't support narrow clones
+  abort: server does not support narrow clones
   [255]
 
 Make a narrow clone (via HGPORT2), then try to narrow and widen
@@ -60,7 +60,5 @@
   looking for local changes to affected paths
   $ hg tracked --addinclude f1 http://localhost:$HGPORT1/
   comparing with http://localhost:$HGPORT1/
-  searching for changes
-  no changes found
-  abort: server doesn't support narrow clones
+  abort: server does not support narrow clones
   [255]
diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -134,7 +134,7 @@
 return orig(pullop, kwargs)
 
 if wireprotoserver.NARROWCAP not in pullop.remote.capabilities():
-raise error.Abort(_("server doesn't support narrow clones"))
+raise error.Abort(_("server does not support narrow clones"))
 orig(pullop, kwargs)
 kwargs['narrow'] = True
 include, exclude = repo.narrowpats
@@ -408,6 +408,13 @@
 url, branches = hg.parseurl(remotepath)
 ui.status(_('comparing with %s\n') % util.hidepassword(url))
 remote = hg.peer(repo, opts, url)
+
+# check narrow support before doing anything if widening needs to be
+# performed. In future we should also abort if client is ellipses and
+# server does not support ellipses
+if widening and wireprotoserver.NARROWCAP not in remote.capabilities():
+raise error.Abort(_("server does not support narrow clones"))
+
 commoninc = discovery.findcommonincoming(repo, remote)
 
 oldincludes, oldexcludes = repo.narrowpats



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


D4789: narrow: check for servers' narrow support before doing anything (BC)

2018-10-01 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  In https://phab.mercurial-scm.org/D4789#72717, @martinvonz wrote:
  
  > > This is BC because new clients won't be able to extend from old 
narrow-enabled servers.
  >
  > I think your previous patch was also BC in that sense since it started 
requiring the server to have the ellipses wire capability when widening with 
ellipsis nodes. It's not a problem for us to add that capability (we already 
have), but you may want to mention it there for consistency :), if I understood 
that right.
  
  
  I am not whether that patch stands as a BC but yes, the whole rework and 
refactoring during this cycle make big BC's in how narrow extension work and I 
doubt that a client with hg-4.8 will be able to use narrow with server which is 
at hg-4.7.

REPOSITORY
  rHG Mercurial

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

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


D4789: narrow: check for servers' narrow support before doing anything (BC)

2018-10-01 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 11518.
pulkit edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4789?vs=11503=11518

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

AFFECTED FILES
  hgext/narrow/narrowcommands.py
  tests/test-narrow-clone-non-narrow-server.t
  tests/test-narrow-clone.t

CHANGE DETAILS

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
@@ -65,7 +65,7 @@
 
   $ hg clone --narrow master narrow-via-localpeer --noupdate --include 
"dir/src/f10"
   requesting all changes
-  abort: server doesn't support narrow clones
+  abort: server does not support narrow clones
   [255]
   $ hg tracked -R narrow-via-localpeer
   abort: repository narrow-via-localpeer not found!
diff --git a/tests/test-narrow-clone-non-narrow-server.t 
b/tests/test-narrow-clone-non-narrow-server.t
--- a/tests/test-narrow-clone-non-narrow-server.t
+++ b/tests/test-narrow-clone-non-narrow-server.t
@@ -39,7 +39,7 @@
 
   $ hg clone --narrow --include f1 http://localhost:$HGPORT1/ narrowclone
   requesting all changes
-  abort: server doesn't support narrow clones
+  abort: server does not support narrow clones
   [255]
 
 Make a narrow clone (via HGPORT2), then try to narrow and widen
@@ -60,7 +60,5 @@
   looking for local changes to affected paths
   $ hg tracked --addinclude f1 http://localhost:$HGPORT1/
   comparing with http://localhost:$HGPORT1/
-  searching for changes
-  no changes found
-  abort: server doesn't support narrow clones
+  abort: server does not support narrow clones
   [255]
diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -134,7 +134,7 @@
 return orig(pullop, kwargs)
 
 if wireprotoserver.NARROWCAP not in pullop.remote.capabilities():
-raise error.Abort(_("server doesn't support narrow clones"))
+raise error.Abort(_("server does not support narrow clones"))
 orig(pullop, kwargs)
 kwargs['narrow'] = True
 include, exclude = repo.narrowpats
@@ -408,6 +408,13 @@
 url, branches = hg.parseurl(remotepath)
 ui.status(_('comparing with %s\n') % util.hidepassword(url))
 remote = hg.peer(repo, opts, url)
+
+# check narrow support before doing anything if widening needs to be
+# performed. In future we should also abort if client is ellipses and
+# server does not support ellipses
+if widening and wireprotoserver.NARROWCAP not in remote.capabilities():
+raise error.Abort(_("server does not support narrow clones"))
+
 commoninc = discovery.findcommonincoming(repo, remote)
 
 oldincludes, oldexcludes = repo.narrowpats



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


D4789: narrow: check for servers' narrow support before doing anything (BC)

2018-10-01 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  > This is BC because new clients won't be able to extend from old 
narrow-enabled servers.
  
  I think your previous patch was also BC in that sense since it started 
requiring the server to have the ellipses wire capability when widening with 
ellipsis nodes. It's not a problem for us to add that capability (we already 
have), but you may want to mention it there for consistency :), if I understood 
that right.

INLINE COMMENTS

> narrowcommands.py:137
>  if wireprotoserver.NARROWCAP not in pullop.remote.capabilities():
>  raise error.Abort(_("server doesn't support narrow clones"))
>  orig(pullop, kwargs)

Change "doesn't" to "does not" here too so it's consistent?

REPOSITORY
  rHG Mercurial

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

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


D4789: narrow: check for servers' narrow support before doing anything (BC)

2018-09-30 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 11503.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4789?vs=11472=11503

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

AFFECTED FILES
  hgext/narrow/narrowcommands.py
  tests/test-narrow-clone-non-narrow-server.t

CHANGE DETAILS

diff --git a/tests/test-narrow-clone-non-narrow-server.t 
b/tests/test-narrow-clone-non-narrow-server.t
--- a/tests/test-narrow-clone-non-narrow-server.t
+++ b/tests/test-narrow-clone-non-narrow-server.t
@@ -60,7 +60,5 @@
   looking for local changes to affected paths
   $ hg tracked --addinclude f1 http://localhost:$HGPORT1/
   comparing with http://localhost:$HGPORT1/
-  searching for changes
-  no changes found
-  abort: server doesn't support narrow clones
+  abort: server does not support narrow clones
   [255]
diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -406,6 +406,13 @@
 url, branches = hg.parseurl(remotepath)
 ui.status(_('comparing with %s\n') % util.hidepassword(url))
 remote = hg.peer(repo, opts, url)
+
+# check narrow support before doing anything if widening needs to be
+# performed. In future we should also abort if client is ellipses and
+# server does not support ellipses
+if widening and wireprotoserver.NARROWCAP not in remote.capabilities():
+raise error.Abort(_("server does not support narrow clones"))
+
 commoninc = discovery.findcommonincoming(repo, remote)
 
 oldincludes, oldexcludes = repo.narrowpats



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


D4789: narrow: check for servers' narrow support before doing anything (BC)

2018-09-28 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Recently we introduced narrow capabilities for the server. So we can check
  whether a server has narrow clone support or not before doing anything. This 
is
  BC because new clients won't be able to extend from old narrow-enabled 
servers.
  I *think* narrow is not used much (maybe just inside Google), also it's
  experimental so I think we can change this. We will need to this someday 
anyway.
  
  The "doesn't" in error is changed to "does not" because I think that's we do 
in
  core and also thats what I typed while writing the error message.
  I am fine with that being dropped too.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowcommands.py
  tests/test-narrow-clone-non-narrow-server.t

CHANGE DETAILS

diff --git a/tests/test-narrow-clone-non-narrow-server.t 
b/tests/test-narrow-clone-non-narrow-server.t
--- a/tests/test-narrow-clone-non-narrow-server.t
+++ b/tests/test-narrow-clone-non-narrow-server.t
@@ -60,7 +60,5 @@
   looking for local changes to affected paths
   $ hg tracked --addinclude f1 http://localhost:$HGPORT1/
   comparing with http://localhost:$HGPORT1/
-  searching for changes
-  no changes found
-  abort: server doesn't support narrow clones
+  abort: server does not support narrow clones
   [255]
diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -407,6 +407,13 @@
 url, branches = hg.parseurl(remotepath)
 ui.status(_('comparing with %s\n') % util.hidepassword(url))
 remote = hg.peer(repo, opts, url)
+
+# check narrow support before doing anything if widening needs to be
+# performed. In future we should also abort if client is ellipses and
+# server does not support ellipses
+if widening and narrowwirepeer.NARROWCAP not in remote.capabilities():
+raise error.Abort(_("server does not support narrow clones"))
+
 commoninc = discovery.findcommonincoming(repo, remote)
 
 oldincludes, oldexcludes = repo.narrowpats



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