Skip to content

Commit

Permalink
pkgdev commit: add all matching pkg versions to historical repo
Browse files Browse the repository at this point in the history
Fixes #40.
  • Loading branch information
radhermit committed Jun 13, 2021
1 parent 5e06989 commit ac0e54e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/pkgdev/scripts/pkgdev_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ def add_pkgs(self, pkgs):

def _populate(self, pkgs):
"""Populate the repo with a given sequence of historical packages."""
paths = list({pkg.key for pkg in pkgs})
paths = {pkg.key for pkg in pkgs}
old_files = subprocess.Popen(
['git', 'archive', 'HEAD'] + paths,
['git', 'archive', 'HEAD'] + list(paths),
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
cwd=self.__parent_repo.location)
if old_files.poll():
Expand Down Expand Up @@ -246,10 +246,11 @@ def __init__(self, options, changes):
def modify(self):
"""Generate summaries for modify actions."""
atom = next(iter(self.changes))
self.old_repo.add_pkgs([atom])
pkgs = self.repo.match(atom)
self.old_repo.add_pkgs(pkgs)
try:
old_pkg = self.old_repo.match(atom)[0]
new_pkg = self.repo.match(atom)[0]
new_pkg = pkgs[0]
except IndexError: # pragma: no cover
# broken ebuild should be caught during manifesting or scanning
return
Expand Down Expand Up @@ -358,10 +359,11 @@ def modify(self):
"""Generate summaries for modify actions."""
if len(self.changes) == 1:
atom = next(iter(self.changes))
self.old_repo.add_pkgs([atom])
pkgs = self.repo.match(atom)
self.old_repo.add_pkgs(pkgs)
try:
old_pkg = self.old_repo.match(atom)[0]
new_pkg = self.repo.match(atom)[0]
new_pkg = pkgs[0]
except IndexError: # pragma: no cover
# broken ebuild should be caught during manifesting or scanning
return
Expand Down

0 comments on commit ac0e54e

Please sign in to comment.