diff -Nru codetree-1.2.0/codetree/handlers/git.py codetree-1.2.0/codetree/handlers/git.py --- codetree-1.2.0/codetree/handlers/git.py 2020-06-23 07:50:14.000000000 +0000 +++ codetree-1.2.0/codetree/handlers/git.py 2021-02-09 09:16:56.000000000 +0000 @@ -18,6 +18,7 @@ "git+file", "git+http", "git+https", + "git+lp", "git+ssh", ) @@ -27,6 +28,9 @@ # strip git+ from the source if scheme in ("git+http", "git+https", "git+ssh"): self.source = source[4:] + elif scheme == "git+lp": + # git+lp:~owner/project/+git/branch => ssh://git.launchpad.net/~owner/project/+git/branch. + self.source = "ssh://git.launchpad.net/{}".format(source[7:]) else: self.source = source diff -Nru codetree-1.2.0/debian/bzr-builder.manifest codetree-1.2.0/debian/bzr-builder.manifest --- codetree-1.2.0/debian/bzr-builder.manifest 2020-06-23 07:50:14.000000000 +0000 +++ codetree-1.2.0/debian/bzr-builder.manifest 2021-02-09 09:16:56.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}-14~121 -lp:codetree revid:mergebot@juju-139df4-prod-is-toolbox-0.canonical.com-20200623074419-khvc4lsjjz91k75p +# bzr-builder format 0.3 deb-version {debupstream}-14~123 +lp:codetree revid:mergebot@juju-139df4-prod-is-toolbox-0.canonical.com-20210209090429-y4odnqasdh5of05e diff -Nru codetree-1.2.0/debian/changelog codetree-1.2.0/debian/changelog --- codetree-1.2.0/debian/changelog 2020-06-23 07:50:14.000000000 +0000 +++ codetree-1.2.0/debian/changelog 2021-02-09 09:16:56.000000000 +0000 @@ -1,8 +1,8 @@ -codetree (1.2.0-14~121~ubuntu16.04.1) xenial; urgency=low +codetree (1.2.0-14~123~ubuntu16.04.1) xenial; urgency=low * Auto build. - -- Launchpad Package Builder Tue, 23 Jun 2020 07:50:14 +0000 + -- Launchpad Package Builder Tue, 09 Feb 2021 09:16:56 +0000 codetree (1.2.0-0) trusty; urgency=medium diff -Nru codetree-1.2.0/README.md codetree-1.2.0/README.md --- codetree-1.2.0/README.md 2020-06-23 07:50:14.000000000 +0000 +++ codetree-1.2.0/README.md 2021-02-09 09:16:56.000000000 +0000 @@ -25,6 +25,8 @@ app/mytag git://github.com/myapp;revno=mytag app2 git+ssh://git@github.com/me/app2.git app3 git+https://github.com/me/my3rdapp.git + app4 git+lp:~owner/project/+git/branch + app5 git+lp:~owner/project;revno=mytag mycharm cs:trusty/mycharm othercharm cs:trusty/othercharm;channel=edge,overwrite=true @@ -38,6 +40,8 @@ * app/mytag is a git checkout of the git repository from github at the tag 'mytag' * app2 is also a git checkout but using a different format for the git url * app3 is another git checkout but using the https style git url understood by codetree +* app4 is a git checkout from ssh://git.launchpad.net/~owner/project/+git/branch +* app5 is a git checkout of the mytag branch from ssh://git.launchpad.net/~owner/project/+git/project (if the project and repository name match, Launchpad allows it to be shortened in this way). * mycharm is a Juju charm from the [charm store](https://jujucharms.com/) ### Source URLs @@ -47,12 +51,12 @@ * Bzr: bzr, bzr+ssh, lp, bzr+http, bzr+https * HTTP/S: http, https * Local: (empty scheme) -* Git: git, git+ssh, git+http, git+https +* Git: git, git+http, git+https, git+lp, git+ssh * Charm Store: cs If you're familiar with Bzr, you'll note that bzr+http and bzr+https are not valid schemes for Bzr URLs. No two handlers may handle the same scheme. In order to definitively identify the handler you want for a source, the scheme you use may be slightly non-standard. -Similarly git+http and git+https are not valid schemas for git URLs, but are used in codetree for exactly the same reason. +Similarly git+http, git+https and git+lp are not valid schemas for git URLs, but are used in codetree for exactly the same reason. Other handlers are planned, such as an archive handler (variant of the http/s handler). diff -Nru codetree-1.2.0/snapcraft.yaml codetree-1.2.0/snapcraft.yaml --- codetree-1.2.0/snapcraft.yaml 2020-06-23 07:50:14.000000000 +0000 +++ codetree-1.2.0/snapcraft.yaml 2021-02-09 09:16:56.000000000 +0000 @@ -3,12 +3,16 @@ description: A tool for collating and building trees of files from various sources. # Switch to strict once https://bugs.launchpad.net/snappy/+bug/1657021 # is addressed. +base: core20 confinement: classic adopt-info: codetree grade: stable apps: codetree: - command: bin/codetree + command: bin/python3 $SNAP/bin/codetree + environment: + PATH: $PATH:$SNAP/usr/bin + PYTHONPATH: $SNAP/lib/python3.8/site-packages # Classic mode has no plugs. # plugs: # - home @@ -17,8 +21,13 @@ parts: codetree: plugin: python - python-version: python3 + python-packages: + - pip + - setuptools + - wheel source: . + build-packages: + - bzr stage-packages: - bzr - git diff -Nru codetree-1.2.0/tests/test_git_handler.py codetree-1.2.0/tests/test_git_handler.py --- codetree-1.2.0/tests/test_git_handler.py 2020-06-23 07:50:14.000000000 +0000 +++ codetree-1.2.0/tests/test_git_handler.py 2021-02-09 09:16:56.000000000 +0000 @@ -56,13 +56,16 @@ def test_url_handling(self): urls = ( - 'git://github.com/juju/juju', - 'git+ssh://git@github.com:juju/juju', - 'git+http://github.com/juju/juju', - 'git+https://github.com/juju/juju', + ('git://github.com/juju/juju', 'git://github.com/juju/juju'), + ('git+http://github.com/juju/juju', 'http://github.com/juju/juju'), + ('git+https://github.com/juju/juju', 'https://github.com/juju/juju'), + ('git+lp:~owner/project/+git/branch', 'ssh://git.launchpad.net/~owner/project/+git/branch'), + ('git+ssh://git@github.com:juju/juju', 'ssh://git@github.com:juju/juju'), ) - for url in urls: - self.assertIn(urlparse(url).scheme, GitSourceHandler.schemes) + for (input_url, resolved_url) in urls: + self.assertIn(urlparse(input_url).scheme, GitSourceHandler.schemes) + githandler = GitSourceHandler(input_url) + self.assertEqual(githandler.source, resolved_url) def test_get_no_options(self): gh = GitSourceHandler("{}/.git".format(self.git_resource_prefix))