~ubuntu-branches/ubuntu/wily/dulwich/wily-proposed

« back to all changes in this revision

Viewing changes to examples/clone.py

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij
  • Date: 2015-09-13 18:15:59 UTC
  • mfrom: (1.5.9) (31.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150913181559-qqjuqtjpr26xzkqs
Tags: 0.11.1-1
* New upstream release.
 + Fixes formatting in assertion. Closes: #789546
 + Fixes FTBFS on some architectures. Closes: #798565
* debian/copyright: Fix license header to be unique.
* debian/watch: Fix watch URL to use pypi redirector service.
* Add 01_refs_unicode: Support running on platforms that can't encode
  certain characters.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
import sys
8
8
from getopt import getopt
9
 
from dulwich.repo import Repo
10
 
from dulwich.client import get_transport_and_path
 
9
from dulwich import porcelain
11
10
 
12
11
opts, args = getopt(sys.argv, "", [])
13
12
opts = dict(opts)
16
15
    print("usage: %s host:path path" % (args[0], ))
17
16
    sys.exit(1)
18
17
 
19
 
# Connect to the remote repository
20
 
client, host_path = get_transport_and_path(args[1])
21
 
path = args[2]
22
 
 
23
 
# Create the local repository
24
 
r = Repo.init(path, mkdir=True)
25
 
 
26
 
# Fetch the remote objects
27
 
remote_refs = client.fetch(host_path, r,
28
 
    determine_wants=r.object_store.determine_wants_all,
29
 
    progress=sys.stdout.write)
30
 
 
31
 
# Update the local head to point at the right object
32
 
r["HEAD"] = remote_refs["HEAD"]
33
 
 
34
 
r._build_tree()
 
18
porcelain.clone(args[1], args[2])