jelmer/dulwich.git
9 years agoImported Upstream version 0.9.7 upstream/0.9.7
Jelmer Vernooij [Sun, 8 Jun 2014 21:51:21 +0000 (23:51 +0200)]
Imported Upstream version 0.9.7

9 years agoRelease 0.9.7. dulwich-0.9.7
Jelmer Vernooij [Sun, 8 Jun 2014 21:45:02 +0000 (23:45 +0200)]
Release 0.9.7.

9 years agoAdd porcelain 'daemon'.
Jelmer Vernooij [Sat, 7 Jun 2014 02:10:21 +0000 (04:10 +0200)]
Add porcelain 'daemon'.

Remove dul-daemon script, and replace with 'dulwich daemon'.

9 years agoAdd some tests for FileSystemBackend and DictBackend.
Jelmer Vernooij [Sat, 7 Jun 2014 01:54:24 +0000 (03:54 +0200)]
Add some tests for FileSystemBackend and DictBackend.

9 years agoRemove --backend option from dulwich.server.main.
Jelmer Vernooij [Sat, 7 Jun 2014 01:51:03 +0000 (03:51 +0200)]
Remove --backend option from dulwich.server.main.

9 years agoAdd default values for outstreams in dulwich.porcelain.
Jelmer Vernooij [Sat, 7 Jun 2014 01:38:40 +0000 (03:38 +0200)]
Add default values for outstreams in dulwich.porcelain.

9 years agoUpdate NEWS.
Jelmer Vernooij [Sat, 7 Jun 2014 01:09:43 +0000 (03:09 +0200)]
Update NEWS.

9 years agoFix logic for extra adds of identical files.
Robert Brown [Fri, 6 Jun 2014 23:11:51 +0000 (19:11 -0400)]
Fix logic for extra adds of identical files.

Additionally, add a test.

9 years agoMove the swift backend to dulwich/contrib.
Jelmer Vernooij [Sat, 7 Jun 2014 00:06:02 +0000 (02:06 +0200)]
Move the swift backend to dulwich/contrib.

Subcommands for initializing repositories on swift are now available
from the dulwich.contrib.swift module. In the future, we could
expose this functionality as a dulwich-swift script. The main reason
I haven't done this yet is to keep it clear that this script is in
contrib.

9 years agoOpenstack Swift backend support for bare repositories
Fabien Boucher [Wed, 7 May 2014 16:18:37 +0000 (18:18 +0200)]
Openstack Swift backend support for bare repositories

This patch adds a new SwiftRepo object that inherits of
BaseRepo. The SwiftRepo object knows how to deal with
git repositories stored on an Openstack object storage
Swift.

Regular filesystems are the defacto backend for Git
repositories but suffers of some limitations in term of
availability and scalability. Using Swift as backend, Git
objects are duplicated in multiple replica, that improves a lot
the disponibity of your repositories, avoids the downtime
due to infrastructure maintenance and also avoids the need to
configure backups. Extending a regular filesystem where
your repositories are stored can be risky and can leads to
downtime. With Swift as backend, extending the storage size
is transparent.

For more details have a look to the README.swift file
provided by this patch.

9 years agoCherry-pick addition of --listen_address/--port argument from dulwich.server from...
Fabien Boucher [Sat, 7 Jun 2014 00:10:53 +0000 (02:10 +0200)]
Cherry-pick addition of --listen_address/--port argument from dulwich.server from a3be3876043e6bf14617a5584287de1e099dcabf.

9 years agoDisable test_delta_large_object for the moment, since it is slow.
Jelmer Vernooij [Fri, 6 Jun 2014 22:17:13 +0000 (00:17 +0200)]
Disable test_delta_large_object for the moment, since it is slow.

9 years agocompat/test_pack: add test that proves large copies in a delta encode correctly
Augie Fackler [Thu, 5 Jun 2014 14:21:03 +0000 (10:21 -0400)]
compat/test_pack: add test that proves large copies in a delta encode correctly

Change-Id: I1a6104344cd960c62273539546cf1581510707f3

9 years agoUpdate NEWS.
Jelmer Vernooij [Fri, 6 Jun 2014 22:04:47 +0000 (00:04 +0200)]
Update NEWS.

9 years agocompat/test_pack: add test that proves we correctly handle medium-sized objects
Augie Fackler [Wed, 4 Jun 2014 22:20:27 +0000 (18:20 -0400)]
compat/test_pack: add test that proves we correctly handle medium-sized objects

What I mean by "medium" in this case is that they're big enough to
require three bytes worth of length information in a copy operation,
but not big enough to require decomposing a copy operation into
multiple sequential copy operations.

Change-Id: I82c28bf8bae5c5c9ed06b79f7380bcdcf4c501e3

9 years agoFor the moment, keep deltification disabled - but add a flag to enable it.
Jelmer Vernooij [Fri, 6 Jun 2014 21:50:58 +0000 (23:50 +0200)]
For the moment, keep deltification disabled - but add a flag to enable it.

9 years agopack.write_pack_objects: when packing, actually build deltas
Augie Fackler [Tue, 3 Jun 2014 18:55:17 +0000 (14:55 -0400)]
pack.write_pack_objects: when packing, actually build deltas

This results in producing smaller packs. Includes a test that verifies
the resulting pack contains a delta and passes git-verify-pack's
checks.

Change-Id: I63f875cfe412ad727bc1364e3ed0a2b1d7214260

9 years agocompat/test_pack: extract parsing of git-verify-pack output
Augie Fackler [Tue, 3 Jun 2014 18:53:02 +0000 (14:53 -0400)]
compat/test_pack: extract parsing of git-verify-pack output

A future test will want to reuse this same logic.

Change-Id: Icd36632331a514479cf8a89cdb0932a9eaf57e08

9 years agopack.write_pack_data: when writing OFS_DELTA entries, write correct offset
Augie Fackler [Tue, 3 Jun 2014 19:21:48 +0000 (15:21 -0400)]
pack.write_pack_data: when writing OFS_DELTA entries, write correct offset

The old code wrote the OFS_DELTA offset as the offset from the start
of the pack file, which is
wrong. git.git/Documentation/technical/pack-format.txt states that the
offset is the number of bytes before the current object header that
the base object header starts, which is what we now write.

A future patch will exercise this code by enabling the writing of
deltas during packing.

Change-Id: Ie8431339e4ca3a6cc4e1969b90150b7a6e464d4c

9 years agoAdd tests for encode functions.
Jelmer Vernooij [Fri, 6 Jun 2014 20:54:46 +0000 (22:54 +0200)]
Add tests for encode functions.

9 years agopack.create_delta: fix copy operations that are larger than 2^24 bytes
Augie Fackler [Thu, 5 Jun 2014 14:24:46 +0000 (10:24 -0400)]
pack.create_delta: fix copy operations that are larger than 2^24 bytes

This correctly decomposes copies of sequences longer than 2^24 into
smaller copy operations, so that really big blobs in a repository
don't result in corrupt packs.

Note that difflib.SequenceMatcher is worst-case O(n^2) on its input,
so this is very slow. We may want to add an optional parameter to the
packing code that specifies a maximum size to deltify (beyond that
size we'd just include fulltexts in the packfile.)

This will be tested by a follow-up change after we enable
deltification in our pack-building code, as the easiest way to prove
this works correctly involves building a pack and feeding it to
git-verify-pack.

Change-Id: Ic30fa433a2f3b88ddb1aacfe4788dbd47b2e4490

9 years agopack.create_delta: correctly encode copy operations up to 2^24 in size
Augie Fackler [Thu, 5 Jun 2014 14:26:53 +0000 (10:26 -0400)]
pack.create_delta: correctly encode copy operations up to 2^24 in size

At present we still produce incorrect results for operations larger
than this size. That defect will be fixed in a follow-up to this
change.

Change-Id: Id63b500ae514caa4339063cde2d6486309a8a056

9 years agopack.create_delta: rename a couple of variables to make the code clearer
Augie Fackler [Wed, 4 Jun 2014 20:25:02 +0000 (16:25 -0400)]
pack.create_delta: rename a couple of variables to make the code clearer

Change-Id: I5fed216800445277d6e069e0b20051006330d405

9 years agopack.create_delta: move encode_size to not be a nested function
Augie Fackler [Wed, 4 Jun 2014 20:03:15 +0000 (16:03 -0400)]
pack.create_delta: move encode_size to not be a nested function

No functional change, just tidies things up a little bit.

Change-Id: I48810dec9788584812dabe36976de60d24fce498

9 years agopack: enhance docstring on deltify_pack_objects
Augie Fackler [Tue, 3 Jun 2014 15:26:49 +0000 (11:26 -0400)]
pack: enhance docstring on deltify_pack_objects

Change-Id: If208d523b3d7bb4d83f7ded2fec47d5c1052bbf0

9 years agoAdd .gitattributes files to force fast-export data for tests to checkout with lf...
Gary van der Merwe [Tue, 3 Jun 2014 17:22:35 +0000 (19:22 +0200)]
Add .gitattributes files to force fast-export data for tests to checkout with lf line endings.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
9 years agoSkip side-band-64k TCP server tests on windows if cgit not >= 1.9.3.
Gary van der Merwe [Thu, 5 Jun 2014 13:04:26 +0000 (15:04 +0200)]
Skip side-band-64k TCP server tests on windows if cgit not >= 1.9.3.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
9 years agoMerge branch 'octal-numbers' of git://github.com/garyvdm/dulwich
Jelmer Vernooij [Thu, 5 Jun 2014 00:55:47 +0000 (02:55 +0200)]
Merge branch 'octal-numbers' of git://github.com/garyvdm/dulwich

9 years agoAdd write_error argument to GitClient.archive().
Jelmer Vernooij [Thu, 5 Jun 2014 00:04:17 +0000 (02:04 +0200)]
Add write_error argument to GitClient.archive().

9 years agoSkip porcelain archive test when c git is not available.
Jelmer Vernooij [Wed, 4 Jun 2014 23:55:48 +0000 (01:55 +0200)]
Skip porcelain archive test when c git is not available.

9 years agoMerge branch 'python3-close-files' of git://github.com/garyvdm/dulwich
Jelmer Vernooij [Wed, 4 Jun 2014 23:40:31 +0000 (01:40 +0200)]
Merge branch 'python3-close-files' of git://github.com/garyvdm/dulwich

9 years agoNews entry for file object closing.
Gary van der Merwe [Wed, 4 Jun 2014 09:27:48 +0000 (11:27 +0200)]
News entry for file object closing.

9 years agoClose file objects.
Gary van der Merwe [Wed, 4 Jun 2014 09:26:31 +0000 (11:26 +0200)]
Close file objects.

9 years agoClose files for Pack objects.
Gary van der Merwe [Wed, 4 Jun 2014 09:02:01 +0000 (11:02 +0200)]
Close files for Pack objects.

9 years agoClose files for Protocol objects.
Gary van der Merwe [Wed, 4 Jun 2014 07:30:09 +0000 (09:30 +0200)]
Close files for Protocol objects.

9 years agoFix another potential XSS issue, and add test for the previous one.
Jelmer Vernooij [Wed, 4 Jun 2014 01:12:43 +0000 (03:12 +0200)]
Fix another potential XSS issue, and add test for the previous one.

9 years agoFix octal number literals.
Gary van der Merwe [Tue, 3 Jun 2014 06:48:50 +0000 (08:48 +0200)]
Fix octal number literals.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
9 years agoMerge branch 'service-name-xss' of git://github.com/durin42/dulwich
Jelmer Vernooij [Tue, 3 Jun 2014 23:49:27 +0000 (01:49 +0200)]
Merge branch 'service-name-xss' of git://github.com/durin42/dulwich

9 years agoweb: don't echo back invalid service names
Dave Borowitz [Fri, 26 Oct 2012 20:17:20 +0000 (15:17 -0500)]
web: don't echo back invalid service names

This prevents potential XSS attacks, which could have injected
arbitrary content under a domain by echoing back the unsupported
service name.

9 years agoUse byte literal in test_pack.py so that module can be imported in py3.
Gary van der Merwe [Tue, 3 Jun 2014 08:53:41 +0000 (10:53 +0200)]
Use byte literal in test_pack.py so that module can be imported in py3.

9 years agoAlter itertools import statement so that 2to3 fixes it.
Gary van der Merwe [Tue, 3 Jun 2014 08:52:31 +0000 (10:52 +0200)]
Alter itertools import statement so that 2to3 fixes it.

9 years agoUse 2to3 in setup.py.
Gary van der Merwe [Wed, 9 Apr 2014 11:29:47 +0000 (13:29 +0200)]
Use 2to3 in setup.py.

9 years agoFix octal number literals.
Gary van der Merwe [Tue, 3 Jun 2014 06:48:50 +0000 (08:48 +0200)]
Fix octal number literals.

9 years agoMerge branch 'py3k' of git://github.com/Ormod/dulwich
Jelmer Vernooij [Tue, 3 Jun 2014 01:35:32 +0000 (03:35 +0200)]
Merge branch 'py3k' of git://github.com/Ormod/dulwich

9 years agoindex: Fix IndexEntry to not include name.
Jelmer Vernooij [Sun, 1 Jun 2014 18:35:33 +0000 (20:35 +0200)]
index: Fix IndexEntry to not include name.

9 years agoNEWS entry for python3 changes.
Gary van der Merwe [Sun, 1 Jun 2014 22:20:42 +0000 (00:20 +0200)]
NEWS entry for python3 changes.

9 years agoUse for loop instead of map.
Gary van der Merwe [Sun, 1 Jun 2014 21:54:27 +0000 (23:54 +0200)]
Use for loop instead of map.

9 years agoStop using more deprecated test methods.
Gary van der Merwe [Sun, 1 Jun 2014 07:50:44 +0000 (09:50 +0200)]
Stop using more deprecated test methods.

9 years agoAdd 'make before-push' target.
Jelmer Vernooij [Sun, 1 Jun 2014 22:05:46 +0000 (00:05 +0200)]
Add 'make before-push' target.

9 years agoAdd pep8 make target and fix some pep8ness.
Jelmer Vernooij [Sun, 1 Jun 2014 21:03:50 +0000 (23:03 +0200)]
Add pep8 make target and fix some pep8ness.

9 years agoAdd 'flakes' target invoking pyflakes, and fix some pyflakes warnings.
Jelmer Vernooij [Sun, 1 Jun 2014 20:36:19 +0000 (22:36 +0200)]
Add 'flakes' target invoking pyflakes, and fix some pyflakes warnings.

9 years agoRemove pylint config.
Jelmer Vernooij [Sun, 1 Jun 2014 20:18:26 +0000 (22:18 +0200)]
Remove pylint config.

9 years agoAdd dulwich.greenthreads module.
Fabien Boucher [Sun, 1 Jun 2014 18:14:53 +0000 (20:14 +0200)]
Add dulwich.greenthreads module.

9 years agosetup: Make setup.py also work on py3k on OS X
Hannu Valtonen [Sat, 31 May 2014 16:09:48 +0000 (19:09 +0300)]
setup: Make setup.py also work on py3k on OS X

9 years agopy3k: These need to return a value since in Py3k they're no longer void
Hannu Valtonen [Sat, 31 May 2014 16:10:21 +0000 (19:10 +0300)]
py3k: These need to return a value since in Py3k they're no longer void

Python 2.x shouldn't care about it though the signature is void there.

As exhibited in error:

dulwich/_diff_tree.c:449:2: error: non-void function 'init_diff_tree'
should return a value [-Wreturn-type]

9 years agopy3k: Go through all uses of itertools and make them work on py3k
Hannu Valtonen [Sat, 31 May 2014 16:42:28 +0000 (18:42 +0200)]
py3k: Go through all uses of itertools and make them work on py3k

9 years agotests: Change assertEquals to be py3k compatible assertEqual.
Hannu Valtonen [Sat, 31 May 2014 14:03:44 +0000 (16:03 +0200)]
tests: Change assertEquals to be py3k compatible assertEqual.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
9 years agoIn Protocol.read_pkt_line, assert the length of the data read matches the length...
Gary van der Merwe [Sat, 24 May 2014 23:03:03 +0000 (01:03 +0200)]
In Protocol.read_pkt_line, assert the length of the data read matches the length prefix.

9 years agoCorrectly handle binascii.Error.
Gary van der Merwe [Sun, 18 May 2014 21:42:23 +0000 (23:42 +0200)]
Correctly handle binascii.Error.

9 years agoUse for loop instead of map when not iterating.
Gary van der Merwe [Fri, 18 Apr 2014 12:31:49 +0000 (14:31 +0200)]
Use for loop instead of map when not iterating.

In PY3, map returns an iterator, so the funcion never gets called.

9 years agoUse assertEqual rather than assertEquals as the latter is deprecated.
Gary van der Merwe [Sun, 18 May 2014 12:53:07 +0000 (14:53 +0200)]
Use assertEqual rather than assertEquals as the latter is deprecated.

9 years agoMake next methods available as __next__.
Gary van der Merwe [Wed, 9 Apr 2014 11:10:43 +0000 (13:10 +0200)]
Make next methods available as __next__.

9 years agoUse int division `//` insted of float division `/`.
Gary van der Merwe [Thu, 3 Apr 2014 19:18:11 +0000 (21:18 +0200)]
Use int division `//` insted of float division `/`.

9 years agoUse io module instead of file.
Gary van der Merwe [Thu, 3 Apr 2014 18:42:45 +0000 (20:42 +0200)]
Use io module instead of file.

9 years agoFix octal literals.
Gary van der Merwe [Sun, 18 May 2014 11:42:22 +0000 (13:42 +0200)]
Fix octal literals.

9 years agoprint(): Switch from statement to funtion.
Michael K [Sat, 10 May 2014 12:44:09 +0000 (14:44 +0200)]
print(): Switch from statement to funtion.

9 years agoUse the print() function in Makefile.
Michael K [Sat, 10 May 2014 10:06:14 +0000 (12:06 +0200)]
Use the print() function in Makefile.

Use the print() function rather than the print statement in the
Makefile.

9 years agoMove logic for creating blog from path to dulwich.index.
Jelmer Vernooij [Sat, 24 May 2014 14:46:03 +0000 (16:46 +0200)]
Move logic for creating blog from path to dulwich.index.

9 years agoAdd test to make sure unmodified files don't show up in get_unstaged_changes.
Jelmer Vernooij [Sat, 24 May 2014 14:34:25 +0000 (16:34 +0200)]
Add test to make sure unmodified files don't show up in get_unstaged_changes.

9 years agoAdd porcelain for 'status'.
Ryan Faulkner [Sat, 24 May 2014 14:20:05 +0000 (16:20 +0200)]
Add porcelain for 'status'.

9 years agoUse namedtuple for index entry.
Michael K [Sat, 10 May 2014 13:08:37 +0000 (15:08 +0200)]
Use namedtuple for index entry.

9 years agoBugfix: cmd_reset could not determine the mode
Michael K [Thu, 15 May 2014 07:15:44 +0000 (09:15 +0200)]
Bugfix: cmd_reset could not determine the mode

9 years agoFix copy-&-paste errors in command line interface.
Michael K [Sat, 10 May 2014 13:08:37 +0000 (15:08 +0200)]
Fix copy-&-paste errors in command line interface.

9 years agoFix typo in tutorial.
Michael [Sat, 10 May 2014 09:31:13 +0000 (11:31 +0200)]
Fix typo in tutorial.

9 years agofix twisted output
Michael [Tue, 6 May 2014 21:12:23 +0000 (23:12 +0200)]
fix twisted output

9 years agoRemove long lines.
Jelmer Vernooij [Tue, 6 May 2014 02:41:51 +0000 (04:41 +0200)]
Remove long lines.

10 years agoUpdate NEWS.
Jelmer Vernooij [Fri, 25 Apr 2014 00:49:02 +0000 (02:49 +0200)]
Update NEWS.

10 years agoAdd symbolic link support to Repo.stage().
Robert Brown [Thu, 24 Apr 2014 23:45:21 +0000 (19:45 -0400)]
Add symbolic link support to Repo.stage().

10 years agoUpdate NEWS.
Jelmer Vernooij [Wed, 23 Apr 2014 22:14:07 +0000 (00:14 +0200)]
Update NEWS.

10 years agoFix tests dependent on hash ordering.
Mike Edgar [Wed, 23 Apr 2014 14:16:31 +0000 (10:16 -0400)]
Fix tests dependent on hash ordering.

10 years agoStart on 0.9.7.
Jelmer Vernooij [Tue, 22 Apr 2014 23:49:18 +0000 (01:49 +0200)]
Start on 0.9.7.

10 years agoImported Upstream version 0.9.6 upstream/0.9.6
Jelmer Vernooij [Tue, 22 Apr 2014 23:40:29 +0000 (01:40 +0200)]
Imported Upstream version 0.9.6

10 years agoRelease 0.9.6. dulwich-0.9.6
Jelmer Vernooij [Tue, 22 Apr 2014 23:28:55 +0000 (01:28 +0200)]
Release 0.9.6.

10 years agoUpdate MANIFEST.in.
Jelmer Vernooij [Tue, 22 Apr 2014 23:28:00 +0000 (01:28 +0200)]
Update MANIFEST.in.

10 years agoConvert README to markdown.
Jelmer Vernooij [Sun, 20 Apr 2014 22:29:06 +0000 (00:29 +0200)]
Convert README to markdown.

10 years agoOnly reload new pack files, and discard old ones when updating pack
Jelmer Vernooij [Sun, 20 Apr 2014 19:03:04 +0000 (21:03 +0200)]
Only reload new pack files, and discard old ones when updating pack
cache.

10 years agoFix leak when pack cache is rebuilt.
Damien Tournoud [Thu, 17 Apr 2014 08:29:04 +0000 (10:29 +0200)]
Fix leak when pack cache is rebuilt.

10 years agoUpdate NEWS, fix test.
Jelmer Vernooij [Wed, 16 Apr 2014 00:46:23 +0000 (02:46 +0200)]
Update NEWS, fix test.

10 years agoDeltaChainIterator: fix a corner case where an object is inflated as an object alread...
Damien Tournoud [Tue, 15 Apr 2014 14:57:09 +0000 (16:57 +0200)]
DeltaChainIterator: fix a corner case where an object is inflated as an object already in the repository. Fixes #135.

10 years agoFix formatting for pydoctor.
Jelmer Vernooij [Sat, 12 Apr 2014 22:58:39 +0000 (00:58 +0200)]
Fix formatting for pydoctor.

10 years agoUpdate NEWS.
Jelmer Vernooij [Sat, 12 Apr 2014 22:37:26 +0000 (00:37 +0200)]
Update NEWS.

10 years agoMerge branch 'github-fix' of git://github.com/sid0/dulwich
Jelmer Vernooij [Sat, 12 Apr 2014 22:35:23 +0000 (00:35 +0200)]
Merge branch 'github-fix' of git://github.com/sid0/dulwich

10 years agoMention python3 related compatibility fixes.
Jelmer Vernooij [Sat, 12 Apr 2014 22:21:27 +0000 (00:21 +0200)]
Mention python3 related compatibility fixes.

10 years agoDon't wait for EOF in _handle_receive_pack_tail
Siddharth Agarwal [Sat, 12 Apr 2014 07:03:11 +0000 (00:03 -0700)]
Don't wait for EOF in _handle_receive_pack_tail

This is the same as the previous commit, except it makes receive-pack (i.e. git
push) to a GitHub repository work again.

10 years agoDon't wait for EOF in _handle_upload_pack_tail with side-band-64k
Siddharth Agarwal [Sat, 12 Apr 2014 06:42:00 +0000 (23:42 -0700)]
Don't wait for EOF in _handle_upload_pack_tail with side-band-64k

As of Sat, 12 Apr 2014 08:46:15 +0000, cloning, fetching or receiving a pack
from a GitHub repository with dulwich results in a hang. For example, the
command:

    bin/dulwich clone git@github.com:jelmer/dulwich.git

produces the following output:

    Reusing existing pack: 12675, done.
    Counting objects: 1408, done.
    Compressing objects: 100% (891/891), done.

and then hangs indefinitely.

This commit and the next one aim to fix that.

The indefinite hang is because _handle_upload_pack_tail waits for an EOF from
the server that never arrives. With canonical Git, both the client and the
server disconnect after the fetch is completed. With canonical Git servers,
Dulwich works fine since the server will disconnect. However, GitHub seems to be
running a non-canonical implementation of Git, which waits for the client to
disconnect. That works fine with canonical Git clients but not with Dulwich.

Is this a bug in the server or the client? This is arguable, but it's reasonable
to assume that no matter how the server acts, the client should disconnect
without waiting for an EOF. Why? Quoting Git's
Documentation/technical/pack-protocol.txt,

    After reference and capabilities discovery, the client can decide to
    terminate the connection by sending a flush-pkt, telling the server it can
    now gracefully terminate, and disconnect, when it does not need any pack
    data. This can happen with the ls-remote command, and also can happen when
    the client already is up-to-date.

This indicates that in general for stateful transports (i.e. not HTTP), the
client is responsible the lifecycle of the connection. The protocol
documentation doesn't explicitly specify what happens after the client fetches a
pack, but I think it's logical to extrapolate similar behaviour.

This patch causes the Dulwich client to disconnect right after the fetch is
complete, which menas that the above clone command completes correctly. Clones
from canonical Git servers continue to work as well.

It is pretty hard to write a test for this patch because the canonical Git
server doesn't behave this way and we don't have access to the GitHub server.

This was originally reported as a bug in hg-git, which uses Dulwich: see
https://bitbucket.org/durin42/hg-git/issue/104/hangs-after-total. Thanks to
John S Long and Marco Molteni for debugging this issue over there.

10 years agoMerge branch 'python3' of git://github.com/garyvdm/dulwich
Jelmer Vernooij [Wed, 2 Apr 2014 22:45:37 +0000 (00:45 +0200)]
Merge branch 'python3' of git://github.com/garyvdm/dulwich

10 years agoRemove monkeypatch for older versions of urlparse.uses_netloc.
Gary van der Merwe [Wed, 2 Apr 2014 17:17:21 +0000 (19:17 +0200)]
Remove monkeypatch for older versions of urlparse.uses_netloc.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
10 years agoRemove ShutdownServerMixIn now that we don't support 2.4 & 2.5.
Gary van der Merwe [Wed, 2 Apr 2014 14:44:58 +0000 (16:44 +0200)]
Remove ShutdownServerMixIn now that we don't support 2.4 & 2.5.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
10 years agoUse next(iter) instead of iter.next()
Gary van der Merwe [Wed, 2 Apr 2014 20:01:51 +0000 (22:01 +0200)]
Use next(iter) instead of iter.next()

10 years agoUse email.parser rather than rfc822.
Gary van der Merwe [Wed, 2 Apr 2014 19:41:10 +0000 (21:41 +0200)]
Use email.parser rather than rfc822.