git-project 0.0.31__tar.gz → 0.0.32__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. {git_project-0.0.31 → git_project-0.0.32}/PKG-INFO +1 -1
  2. {git_project-0.0.31 → git_project-0.0.32}/_version.py +2 -2
  3. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/git.py +27 -7
  4. {git_project-0.0.31 → git_project-0.0.32}/.git +0 -0
  5. {git_project-0.0.31 → git_project-0.0.32}/.gitignore +0 -0
  6. {git_project-0.0.31 → git_project-0.0.32}/CONTRIBUTORS +0 -0
  7. {git_project-0.0.31 → git_project-0.0.32}/COPYING +0 -0
  8. {git_project-0.0.31 → git_project-0.0.32}/MANIFEST.in +0 -0
  9. {git_project-0.0.31 → git_project-0.0.32}/docs/Makefile +0 -0
  10. {git_project-0.0.31 → git_project-0.0.32}/docs/authors.rst +0 -0
  11. {git_project-0.0.31 → git_project-0.0.32}/docs/changelog.rst +0 -0
  12. {git_project-0.0.31 → git_project-0.0.32}/docs/conf.py +0 -0
  13. {git_project-0.0.31 → git_project-0.0.32}/docs/index.rst +0 -0
  14. {git_project-0.0.31 → git_project-0.0.32}/docs/intro.rst +0 -0
  15. {git_project-0.0.31 → git_project-0.0.32}/docs/license.rst +0 -0
  16. {git_project-0.0.31 → git_project-0.0.32}/docs/make.bat +0 -0
  17. {git_project-0.0.31 → git_project-0.0.32}/pyproject.toml +0 -0
  18. {git_project-0.0.31 → git_project-0.0.32}/requirements.txt +0 -0
  19. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/__init__.py +0 -0
  20. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/commandline.py +0 -0
  21. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/configobj.py +0 -0
  22. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/exception.py +0 -0
  23. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/gitproject.py +0 -0
  24. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/main.py +0 -0
  25. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/parsermanager.py +0 -0
  26. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/plugin.py +0 -0
  27. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/pluginmanager.py +0 -0
  28. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/project.py +0 -0
  29. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/runnable.py +0 -0
  30. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/scopedobj.py +0 -0
  31. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/shell.py +0 -0
  32. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/substitutable.py +0 -0
  33. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/test_support/__init__.py +0 -0
  34. {git_project-0.0.31 → git_project-0.0.32}/src/git_project/test_support/common.py +0 -0
  35. {git_project-0.0.31 → git_project-0.0.32}/tests/conftest.py +0 -0
  36. {git_project-0.0.31 → git_project-0.0.32}/tests/test_confobj.py +0 -0
  37. {git_project-0.0.31 → git_project-0.0.32}/tests/test_git.py +0 -0
  38. {git_project-0.0.31 → git_project-0.0.32}/tests/test_gitproject.py +0 -0
  39. {git_project-0.0.31 → git_project-0.0.32}/tests/test_main.py +0 -0
  40. {git_project-0.0.31 → git_project-0.0.32}/tests/test_project.py +0 -0
  41. {git_project-0.0.31 → git_project-0.0.32}/tests/test_runnable.py +0 -0
  42. {git_project-0.0.31 → git_project-0.0.32}/tests/test_scopedobj.py +0 -0
  43. {git_project-0.0.31 → git_project-0.0.32}/tests/test_substitutable.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-project
3
- Version: 0.0.31
3
+ Version: 0.0.32
4
4
  Summary: The extensible stupid project manager
5
5
  Author-email: "David A. Greene" <dag@obbligato.org>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.0.31'
21
- __version_tuple__ = version_tuple = (0, 0, 31)
20
+ __version__ = version = '0.0.32'
21
+ __version_tuple__ = version_tuple = (0, 0, 32)
@@ -48,7 +48,7 @@ class Git(object):
48
48
  implement git-project functionality."""
49
49
 
50
50
  class RemoteCallbacks(pygit2.RemoteCallbacks):
51
- def __init__(self):
51
+ def __init__(self, ssh_id: str):
52
52
  self.started_transfer = False
53
53
  self.transfer_done = False
54
54
 
@@ -57,11 +57,15 @@ class Git(object):
57
57
 
58
58
  self.null_oid = pygit2.Oid(hex='0000000000000000000000000000000000000000')
59
59
 
60
+ self.ssh_id = ssh_id
61
+
60
62
  def credentials(self, url, username_from_url, allowed_types):
61
63
  if allowed_types & pygit2.enums.CredentialType.SSH_KEY:
62
64
  return pygit2.Keypair(
63
- username_from_url, str(Path.home() / '.ssh' / 'id_rsa.pub'),
64
- str(Path.home() / '.ssh' / 'id_rsa'), ''
65
+ username_from_url,
66
+ str(Path.home() / '.ssh' / f'{self.ssh_id}.pub'),
67
+ str(Path.home() / '.ssh' / self.ssh_id),
68
+ ''
65
69
  )
66
70
  elif allowed_types & pygit2.enums.CredentialType.USERNAME:
67
71
  return pygit2.Username(username_from_url)
@@ -373,11 +377,18 @@ class Git(object):
373
377
  del self._sections[section_name]
374
378
 
375
379
  class RemoteBranchDeleteCallback(pygit2.RemoteCallbacks):
380
+ def __init__(self, ssh_id: str):
381
+ super().__init__(ssh_id)
382
+
376
383
  """Check the result of remove branch prune operations."""
377
384
  def credentials(self, url, username_from_url, allowed_types):
378
385
  if allowed_types & pygit2.enums.CredentialType.SSH_KEY:
379
- return pygit2.Keypair(username_from_url, str(Path.home() / '.ssh' / 'id_rsa.pub'),
380
- str(Path.home() / '.ssh' / 'id_rsa'), '')
386
+ return pygit2.Keypair(
387
+ username_from_url,
388
+ str(Path.home() / '.ssh' / f'{self.ssh_id}.pub'),
389
+ str(Path.home() / '.ssh' / self.ssh_id),
390
+ ''
391
+ )
381
392
  elif allowed_types & pygit2.enums.CredentialType.USERNAME:
382
393
  return pygit2.Username(username_from_url)
383
394
  return None
@@ -388,6 +399,9 @@ class Git(object):
388
399
  format(message))
389
400
 
390
401
  class LsRemotesCallbacks(pygit2.RemoteCallbacks):
402
+ def __init__(self, ssh_id: str):
403
+ super().__init__(ssh_id)
404
+
391
405
  def credentials(self, url, username_from_url, allowed_types):
392
406
  if allowed_types & pygit2.enums.CredentialType.SSH_KEY:
393
407
  return pygit2.Keypair(username_from_url, str(Path.home() / '.ssh' / 'id_rsa.pub'),
@@ -421,6 +435,10 @@ class Git(object):
421
435
  if self.has_repo():
422
436
  self._config = self.Config(self, self._repo.config)
423
437
 
438
+ def get_ssh_id(self):
439
+ """Return the ssh ID to use for this repository."""
440
+ return self.config.get_item('ssh', 'id')
441
+
424
442
  def is_bare_repository(self):
425
443
  """Return whether the configured repository is bare."""
426
444
  return self._repo.is_bare
@@ -821,7 +839,9 @@ class Git(object):
821
839
  # (local) name of the branch on the remote side. Assume for now that
822
840
  # it's the same as our local name.
823
841
  remote_refname = self.get_remote_push_refname(refname, remote)
824
- for item in self._repo.remotes[remote].ls_remotes(callbacks=Git.LsRemotesCallbacks()):
842
+ for item in self._repo.remotes[remote].ls_remotes(
843
+ callbacks=Git.LsRemotesCallbacks(self.get_ssh_id())
844
+ ):
825
845
  if not item['local'] and item['name'] == refname:
826
846
  return True
827
847
  return False
@@ -832,7 +852,7 @@ class Git(object):
832
852
  # reason push :branch_name doesn't work. push
833
853
  # :remotes/<remote>/branch_name also doesn't work.
834
854
  refname = self.branch_name_to_refname(branch_name)
835
- callback = self.RemoteBranchDeleteCallback();
855
+ callback = self.RemoteBranchDeleteCallback(self.get_ssh_id());
836
856
  refspecs = [f':{refname}']
837
857
  remote = self._repo.remotes[remote]
838
858
  remote.push(refspecs, callback)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes