Tue, 07 Apr 2015 15:16:19 -0700 test-manifest: add some test coverage for treemanifest
Drew Gottlieb <drgott@google.com> [Tue, 07 Apr 2015 15:16:19 -0700] rev 24656
test-manifest: add some test coverage for treemanifest Similar to the testmanifest test case, testtreemanifest extends the base test case but uses treemanifests instead of manifestdicts. Adding this test provides some basic test coverage of treemanifest within the standard test suite.
Tue, 07 Apr 2015 15:16:19 -0700 test-manifest: make manifesttest a base class that is extended
Drew Gottlieb <drgott@google.com> [Tue, 07 Apr 2015 15:16:19 -0700] rev 24655
test-manifest: make manifesttest a base class that is extended The implementation of the testmanifest test case is moved to a new base class, which is then extended to make the testmanifest. And instead of testmanifest, the subclass is named testmanifestdict because, well, that's what it's testing. This refactoring makes it possible to create alternate versions of what was formerly testmanifest, improving test coverage of different manifestdict implementations.
Tue, 07 Apr 2015 15:16:19 -0700 test-manifest: move parsemanifest() to be a testmanifest class method
Drew Gottlieb <drgott@google.com> [Tue, 07 Apr 2015 15:16:19 -0700] rev 24654
test-manifest: move parsemanifest() to be a testmanifest class method This refactoring lets testmanifest subclasses override this method to return different manifestdict implementations, such as treemanifest. It is useful for later commits where the testmanifest class is moved into a base class, and test cases that extend the base class can provide their own parsemanifest() implementation.
Tue, 07 Apr 2015 22:31:36 -0400 windows: allow readpipe() to actually read data out of the pipe
Matt Harbison <matt_harbison@yahoo.com> [Tue, 07 Apr 2015 22:31:36 -0400] rev 24653
windows: allow readpipe() to actually read data out of the pipe It appears that the read() in readpipe() never actually ran before (in test-ssh.t anyway). A print of the size returned from os.fstat() is 0 for every single print output in test-ssh.t, so the data in the pipe ends up being read later instead of when it is available. This is the same problem as Linux, as mentioned in 331cbf088c4c. There are several places in the Windows SSH tests where the order of local output vs remote output differ from the other platforms. This only fixes one of those cases (and interstingly, not the one added in order to test 331cbf088c4c), so there is more investigation needed. However, without this patch, test-ssh.t also has this diff: --- c:/Users/Matt/Projects/hg/tests/test-ssh.t +++ c:/Users/Matt/Projects/hg/tests/test-ssh.t.err @@ -397,11 +397,11 @@ $ hg push --ssh "sh ../ssh.sh" pushing to ssh://user@dummy/*/remote (glob) searching for changes - remote: Permission denied - remote: abort: prechangegroup.hg-ssh hook failed - remote: Permission denied - remote: pushkey-abort: prepushkey.hg-ssh hook failed updating 6c0482d977a3 to public failed! + remote: Permission denied + remote: abort: prechangegroup.hg-ssh hook failed + remote: Permission denied + remote: pushkey-abort: prepushkey.hg-ssh hook failed [1] $ cd .. Output with this change was stable over 600+ runs of test-ssh.t. I initially tried a background thread to read the pipe[1], but this was simpler and the test results were exactly the same. I also tried SetNamedPipeHandleState(), but the PIPE_NOWAIT is for compatibility with LANMAN 2.0, not for async I/O (the results were identical though). [1] http://eyalarubas.com/python-subproc-nonblock.html
Tue, 07 Apr 2015 22:30:25 -0400 win32: add a method to fetch the available pipe data size
Matt Harbison <matt_harbison@yahoo.com> [Tue, 07 Apr 2015 22:30:25 -0400] rev 24652
win32: add a method to fetch the available pipe data size This will be used in the next patch to do nonblocking reads from the child process, like on posix platforms. See that for why os.fstat() is insufficient.
Tue, 07 Apr 2015 20:43:04 -0700 dirs._addpath: reinstate use of Py_CLEAR
Siddharth Agarwal <sid0@fb.com> [Tue, 07 Apr 2015 20:43:04 -0700] rev 24651
dirs._addpath: reinstate use of Py_CLEAR I changed this to an explicit Py_DECREF + set to null in 6f0e6fa9fdd7. This was a silly misunderstanding on my part -- for some reason I thought Py_CLEAR set its argument to null only if its refcount reached 0. Turns out that's not actually the case -- Py_CLEAR is just Py_DECREF + set to null with some additional precautions around destructors that aren't relevant here. The real bug that 6f0e6fa9fdd7 fixed was the fact that we were mutating the string after setting it in the Python dictionary.
Mon, 06 Apr 2015 18:31:59 -0700 exchange: introduce a '_canusebundle2' function
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 06 Apr 2015 18:31:59 -0700] rev 24650
exchange: introduce a '_canusebundle2' function This function refactors the logic that decides to use 'bundle2' during an exchange (pull/push). This will help being consistent while transitioning from the experimental protocol to the final frozen version. I do not expect this function to survive on the long run when using 'bundle2' will become a simple capability check. This is also necessary to allow HG2Y support in an extension to ease transition of companies using the experimental protocol in production (yeah...). Such extension will be able to wrap this function to use the experimental protocol in some case.
Tue, 07 Apr 2015 16:01:32 -0700 bundle2: detect bundle2 stream/request on /HG2./ instead of /HG2Y/
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 07 Apr 2015 16:01:32 -0700] rev 24649
bundle2: detect bundle2 stream/request on /HG2./ instead of /HG2Y/ To support more bundle2 formats, we need a wider detection of bundle2-family streams. The various places what were explicitly detecting the full magic string are now matching on the first three characters of it.
Mon, 06 Apr 2015 17:23:11 -0700 unbundle20: allow generic dispatch between unbundlers
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 06 Apr 2015 17:23:11 -0700] rev 24648
unbundle20: allow generic dispatch between unbundlers We now take full advantage of the 'getunbundler' function by using a '{version -> unbundler-class}' mapping. This map currently contains a single entry but will make it easy to support more versions from an extension/the future. At some point, this map will probably contain bundler-class information too, in the same fashion the packer map does. However, this is not critically required right now so it will happen by itself when needed. The main target is to allow HG2Y support in an extension to ease transition of companies using the experimental protocol in production (yeah...) But I've no doubt this will be useful when playing with a future HG21.
Tue, 07 Apr 2015 15:18:52 -0700 treemanifest: refactor treemanifest.walk()
Drew Gottlieb <drgott@google.com> [Tue, 07 Apr 2015 15:18:52 -0700] rev 24647
treemanifest: refactor treemanifest.walk() This refactor is a preparation for an optimization in the next commit. This introduces a recursive element that recurses each submanifest. By using a recursive function, the next commit can avoid walking over some subdirectories altogether.
(0) -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 tip