diff tests/test-narrow-widen-non-ellipsis.t @ 39356:c8e4eae84808

narrow: add server logic to send cg while widening without ellipsis Before this patch, if you try to widen a narrow clone without ellipsis enabled, it will be broken and the exchange.pull() done by tracked command to widen the clone will be no-op because no custom logic exists for this and server sees that we have all csets and it says `no changes found`. The widening with ellipsis send KILL for existing changegroups and send new changegroups because of the change in ellipsis hash, but we can prevent that in non-ellipsis cases. This patch adds server side logic to send the changegroups for the changesets which are on the client again with filelogs and manifests for the new includes. This is a very starting implementation and we send changegroups and manifests too while we can prevent them. Following things can definitely be improved in the logic this patch adds: 1) Send just the filelogs and treemanifests 2) Send the filelogs only for the additions in the include I tried 1) here but the code is coupled tightly and the way I was able to do that was hacking into the changegroup generation code in a very dirty way, like adding conditionals and preventing the yield. This patch also adds a 'widen' kwarg to prevent other commands except widening to go through that codepath. The test changes demonstrate that the new implementation is correct and fixes things. Differential Revision: https://phab.mercurial-scm.org/D4383
author Pulkit Goyal <pulkit@yandex-team.ru>
date Sun, 26 Aug 2018 20:20:34 +0300
parents bca0546a44bf
children 2b8adb7ca39a
line wrap: on
line diff
--- a/tests/test-narrow-widen-non-ellipsis.t	Mon Aug 27 13:30:08 2018 +0300
+++ b/tests/test-narrow-widen-non-ellipsis.t	Sun Aug 26 20:20:34 2018 +0300
@@ -89,6 +89,10 @@
   comparing with ssh://user@dummy/master
   searching for changes
   no changes found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 0 changesets with 0 changes to 1 files
   3 local changesets published
   $ hg tracked
   I path:inside
@@ -141,6 +145,10 @@
   comparing with ssh://user@dummy/master
   searching for changes
   no changes found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 0 changesets with 4 changes to 2 files
   5 local changesets published
   abort: path ends in directory separator: widest/
   [255]
@@ -247,6 +255,10 @@
   comparing with ssh://user@dummy/upstream
   searching for changes
   no changes found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 0 changesets with 1 changes to 5 files
   11 local changesets published
   abort: path ends in directory separator: d1/
   [255]
@@ -274,9 +286,12 @@
   checking changesets
   checking manifests
   checking directory manifests
+  warning: orphan data file 'meta/d1/00manifest.i'
   crosschecking files in changesets and manifests
   checking files
+  warning: orphan data file 'data/d1/f.i'
   4 files, 11 changesets, 4 total revisions
+  2 warnings encountered!
 
 Widening preserves parent of local commit
 
@@ -340,6 +355,10 @@
   comparing with ssh://user@dummy/upstream
   searching for changes
   no changes found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 0 changesets with 1 changes to 2 files
   11 local changesets published
   abort: path ends in directory separator: d1/
   [255]