Merge ~racb/git-ubuntu:changelog-parents into git-ubuntu:master

Proposed by Robie Basak
Status: Merged
Merged at revision: fd197c345d0230cb721e62f62dbf01f0569a4003
Proposed branch: ~racb/git-ubuntu:changelog-parents
Merge into: git-ubuntu:master
Diff against target: 972 lines (+357/-156)
2 files modified
gitubuntu/importer.py (+155/-106)
gitubuntu/importer_test.py (+202/-50)
Reviewer Review Type Date Requested Status
Bryce Harrington Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+378744@code.launchpad.net

Commit message

Make Jenkins happy

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:969c7def7266a904c1a306d743503a7083563f5f
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/469/
Executed test runs:
    SUCCESS: VM Setup
    SUCCESS: Build
    FAILED: Unit Tests

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/469//rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:7e2fc4a379cee2d411b880700e8c621e0a86066c
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/470/
Executed test runs:
    SUCCESS: VM Setup
    SUCCESS: Build
    SUCCESS: Unit Tests
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/470//rebuild

review: Approve (continuous-integration)
Revision history for this message
Bryce Harrington (bryce) wrote :

I have a few very minor suggestions, but looks ok overall.

While this is a big patch, most of the code changes were straightforward to review; there were a few pytest mechanisms I wasn't familiar with, and there were a couple chunks of code that took me some time to untangle, but in the end I didn't spot any logical errors.

Since it's nicely broken up into conceptually distinct patches, I reviewed the code sequentially by patch, so am giving feedback thusly organized, hopefully it'll be clear what lines I'm referring to.

1. importer: drop unused variable
    √ LGTM. Simple cleanup

2. Add test: test_get_existing_import_tags_ordering
    - 'repo' parameter could use a doc, e.g.:
      ":param gitubuntu.git_repository.GitUbuntuRepository repo: the repository to use."
    - Add comment to explain "repo_builder.Repo(...)", e.g.
      "# Construct a synthetic git repository containing tags"
    - Rename 'mock' variable to 'mock_repo'

3. Sort reimport tags before using them
    √ LGTM. Interesting illustration of splitting the test from the fix via xfail.

4. Allow for multiple changelog parents
    √ Previously the code checked that changelog_parent_commit is not None, but
      now it checks len(changelog_parent_commits) != 0. Logically this
      works fine, the one caveat being that this now implies an assumption
      that changelog_parent_commits MUST be a list; if None ever got passed
      in then things will break. I did not spot any places where this is
      likely to happen, though.
    - Given that changelog_parent_commits is always assumed to be a list,
      there is a check around line 607 in _commit_import() that is probably
      unnecessary. It used to be a None check, and now is effectively a
      len()>0 check, however l.extend([]) will be a no-op so no need for a check.

5. test_get_import_commit_msg: multiple parent case
    √ LGTM. I wondered if this could be done as an xfail test case, but it's fine as is.

6. Generalise test_get_changelog_parent_commits
    - Param docs for test_get_changelog_parent_commits() would be nice to add
    √ Otherwise, LGTM

7. Add multiple changelog parent tests
    √ LGTM

8. Support multiple changelog parents
    √ The list comprehension for calculating changelog_parent_commits feels a bit
      dense pythonically but on further review it's just using idioms already
      common in importer.py.

As mentioned in #6, some of the test cases in importer_test.py are documented but not all; would be nice to ensure each of the 3 or 4 test cases added or changed in this patchset also gain docs while we're at it.

review: Needs Fixing
Revision history for this message
Robie Basak (racb) wrote :

> 2. Add test: test_get_existing_import_tags_ordering
> - 'repo' parameter could use a doc, e.g.:
> ":param gitubuntu.git_repository.GitUbuntuRepository repo: the
> repository to use."

Done, but note that importantly it's a fixture, so I noted that also.

> - Add comment to explain "repo_builder.Repo(...)", e.g.
> "# Construct a synthetic git repository containing tags"

Done.

> - Rename 'mock' variable to 'mock_repo'

Actually it's not a mock Repo; it's a mocked method on the Repo class.
But I take your point, so I called it mock_get_all_reimport_tags. Since
this is quite long, it busted the line length limit so I also had to
introduce mock_get_all_reimport_tags_patch and wrap a few other lines
too.

> 4. Allow for multiple changelog parents
> √ Previously the code checked that changelog_parent_commit is not
> None, but now it checks len(changelog_parent_commits) != 0.
> Logically this works fine, the one caveat being that this now
> implies an assumption that changelog_parent_commits MUST be a
> list; if None ever got passed in then things will break. I did
> not spot any places where this is likely to happen, though.

Yes - that's the intention. changelog_parent_commits is always a list
now, and we use an empty list instead of None now, in all cases, to
represent that there aren't any.

> - Given that changelog_parent_commits is always assumed to be a list,
> there is a check around line 607 in _commit_import() that is probably
> unnecessary. It used to be a None check, and now is effectively a
> len()>0 check, however l.extend([]) will be a no-op so no need
> for a check.

Good point. Check removed.

> 5. test_get_import_commit_msg: multiple parent case
> √ LGTM. I wondered if this could be done as an xfail test case,
> but it's fine as is.

This was a case that the code was already correct but it lacked a test,
so the xfail process didn't apply. I'm not sure if you already said
that.

> 6. Generalise test_get_changelog_parent_commits
> - Param docs for test_get_changelog_parent_commits() would be nice to add

Done.

> √ Otherwise, LGTM

> As mentioned in #6, some of the test cases in importer_test.py are
> documented but not all; would be nice to ensure each of the 3 or 4
> test cases added or changed in this patchset also gain docs while
> we're at it.

Done. I've ensured that every test case touched has a docstring. I did
this in a new commit at the end of the patchset. Some of this new
documentation exposes some shortcomings in the implementation, but in
the interest of making progress I documented the code as-is, leaving
improvements to the code for the future.

Revision history for this message
Robie Basak (racb) wrote :

Here's the range-diff for your reference: http://paste.ubuntu.com/p/bWR7zShPxp/

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:fd197c345d0230cb721e62f62dbf01f0569a4003
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/475/
Executed test runs:
    SUCCESS: VM Setup
    SUCCESS: Build
    SUCCESS: Unit Tests
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/475//rebuild

review: Approve (continuous-integration)
Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks for the range-diff, all looks good, +1.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/gitubuntu/importer.py b/gitubuntu/importer.py
index 98a0997..495a22d 100644
--- a/gitubuntu/importer.py
+++ b/gitubuntu/importer.py
@@ -488,15 +488,19 @@ def main(
488def get_changelog_for_commit(488def get_changelog_for_commit(
489 repo,489 repo,
490 tree_hash,490 tree_hash,
491 changelog_parent_commit,491 changelog_parent_commits,
492):492):
493 """Extract changes to debian/changelog in this publish493 """Extract changes to debian/changelog in this publish
494494
495 LP: #1633114 -- favor the changelog parent's diff495 LP: #1633114 -- favor the changelog parent's diff
496 """496 """
497 raw_clog_entry = b''497 raw_clog_entry = b''
498 if changelog_parent_commit is not None:498 # If there is more than one changelog parent then don't attempt to combine
499 cmd = ['diff-tree', '-p', changelog_parent_commit,499 # their entries, and instead return nothing (raw_clog_entry will remain
500 # b''). This can be addressed later when the specification better defines
501 # what the commit message should say in this case, but will do for now.
502 if len(changelog_parent_commits) == 1:
503 cmd = ['diff-tree', '-p', changelog_parent_commits[0],
500 tree_hash, '--', 'debian/changelog']504 tree_hash, '--', 'debian/changelog']
501 raw_clog_entry, _ = repo.git_run(cmd, decode=False)505 raw_clog_entry, _ = repo.git_run(cmd, decode=False)
502506
@@ -529,10 +533,32 @@ def get_import_commit_msg(
529 target_head_name,533 target_head_name,
530 namespace,534 namespace,
531 tree_hash,535 tree_hash,
532 changelog_parent_commit,536 changelog_parent_commits,
533 upload_parent_commit,537 upload_parent_commit,
534 unapplied_parent_commit,538 unapplied_parent_commit,
535):539):
540 """Compose an appropriate commit message
541
542 When the importer synthesizes a commit, it needs to provide an appropriate
543 commit message. This function centralizes the generation of that message
544 based on the parameters given.
545
546 :param GitUbuntuRepository repo: the repository in which the tree being
547 committed can be found
548 :param str version: the package version string being committed
549 :param str target_head_name: the nominal name of the branch to which the
550 commit is being made
551 :param str namespace: the namespace name to prefix to the nominal branch
552 name to determine the final branch name
553 :param str tree_hash: the hash of the tree object being committed
554 :param list(str) changelog_parent_commits: any changelog parents to use in
555 the commit
556 :param str upload_parent_commit: the upload parent to use in the commit, or
557 None if there isn't one
558 :param str unapplied_parent_commit: the unapplied parent to use in the
559 commit, or None if this is an applied branch commit
560
561 """
536 if unapplied_parent_commit:562 if unapplied_parent_commit:
537 import_type = 'patches-applied'563 import_type = 'patches-applied'
538 else:564 else:
@@ -543,7 +569,7 @@ def get_import_commit_msg(
543 changelog_entry = get_changelog_for_commit(569 changelog_entry = get_changelog_for_commit(
544 repo,570 repo,
545 tree_hash,571 tree_hash,
546 changelog_parent_commit572 changelog_parent_commits
547 )573 )
548574
549 msg = (575 msg = (
@@ -554,10 +580,10 @@ def get_import_commit_msg(
554 )580 )
555 )581 )
556582
557 if any([changelog_parent_commit, upload_parent_commit, unapplied_parent_commit]):583 if any([changelog_parent_commits, upload_parent_commit, unapplied_parent_commit]):
558 msg += b'\n'584 msg += b'\n'
559585
560 if changelog_parent_commit is not None:586 for changelog_parent_commit in changelog_parent_commits:
561 msg += b'\nChangelog parent: %b' % changelog_parent_commit.encode()587 msg += b'\nChangelog parent: %b' % changelog_parent_commit.encode()
562 if upload_parent_commit is not None:588 if upload_parent_commit is not None:
563 msg += b'\nUpload parent: %b' % upload_parent_commit.encode()589 msg += b'\nUpload parent: %b' % upload_parent_commit.encode()
@@ -574,7 +600,7 @@ def _commit_import(
574 target_head_name,600 target_head_name,
575 tree_hash,601 tree_hash,
576 namespace,602 namespace,
577 changelog_parent_commit,603 changelog_parent_commits,
578 upload_parent_commit,604 upload_parent_commit,
579 unapplied_parent_commit,605 unapplied_parent_commit,
580 commit_date,606 commit_date,
@@ -594,8 +620,8 @@ def _commit_import(
594 :param target_head_name str Git branch name to import to620 :param target_head_name str Git branch name to import to
595 :param namespace str Namespace under which relevant refs can be621 :param namespace str Namespace under which relevant refs can be
596 found.622 found.
597 :param changelog_parent_commit str Git commit hash of623 :param list(str) changelog_parent_commits Git commit hashes of changelog
598 changelog parent.624 parents.
599 :param upload_parent_commit str Git commit hash of625 :param upload_parent_commit str Git commit hash of
600 upload parent. Should be None if patches-applied import.626 upload parent. Should be None if patches-applied import.
601 :param unapplied_parent_commit str Git commit hash of unapplied627 :param unapplied_parent_commit str Git commit hash of unapplied
@@ -605,16 +631,12 @@ def _commit_import(
605 :rtype str631 :rtype str
606 :returns Hash of created commit632 :returns Hash of created commit
607 """633 """
608 changelog_entry = get_changelog_for_commit(
609 repo,
610 tree_hash,
611 changelog_parent_commit
612 )
613
614 parents = []634 parents = []
615635
616 if changelog_parent_commit is not None:636 parents.extend(
617 parents.append(pygit2.Oid(hex=changelog_parent_commit))637 pygit2.Oid(hex=changelog_parent_commit)
638 for changelog_parent_commit in changelog_parent_commits
639 )
618 if upload_parent_commit is not None:640 if upload_parent_commit is not None:
619 parents.append(pygit2.Oid(hex=upload_parent_commit))641 parents.append(pygit2.Oid(hex=upload_parent_commit))
620 if unapplied_parent_commit is not None:642 if unapplied_parent_commit is not None:
@@ -629,7 +651,7 @@ def _commit_import(
629 target_head_name=target_head_name,651 target_head_name=target_head_name,
630 namespace=namespace,652 namespace=namespace,
631 tree_hash=tree_hash,653 tree_hash=tree_hash,
632 changelog_parent_commit=changelog_parent_commit,654 changelog_parent_commits=changelog_parent_commits,
633 upload_parent_commit=upload_parent_commit,655 upload_parent_commit=upload_parent_commit,
634 unapplied_parent_commit=unapplied_parent_commit,656 unapplied_parent_commit=unapplied_parent_commit,
635 ),657 ),
@@ -644,7 +666,7 @@ def commit_unapplied_patches_import(
644 head_name,666 head_name,
645 import_tree_hash,667 import_tree_hash,
646 namespace,668 namespace,
647 changelog_parent_commit,669 changelog_parent_commits,
648 upload_parent_commit,670 upload_parent_commit,
649 commit_date,671 commit_date,
650):672):
@@ -654,7 +676,7 @@ def commit_unapplied_patches_import(
654 head_name,676 head_name,
655 import_tree_hash,677 import_tree_hash,
656 namespace,678 namespace,
657 changelog_parent_commit,679 changelog_parent_commits,
658 upload_parent_commit,680 upload_parent_commit,
659 # unapplied trees do not have a distinct unapplied parent681 # unapplied trees do not have a distinct unapplied parent
660 None,682 None,
@@ -667,7 +689,7 @@ def commit_applied_patches_import(
667 head_name,689 head_name,
668 import_tree_hash,690 import_tree_hash,
669 namespace,691 namespace,
670 changelog_parent_commit,692 changelog_parent_commits,
671 unapplied_parent_commit,693 unapplied_parent_commit,
672 commit_date,694 commit_date,
673):695):
@@ -677,7 +699,7 @@ def commit_applied_patches_import(
677 head_name,699 head_name,
678 import_tree_hash,700 import_tree_hash,
679 namespace,701 namespace,
680 changelog_parent_commit,702 changelog_parent_commits,
681 # uploads will be unapplied trees currently, so applied trees703 # uploads will be unapplied trees currently, so applied trees
682 # can not have them as direct parents704 # can not have them as direct parents
683 None,705 None,
@@ -985,16 +1007,35 @@ def get_existing_import_tags(
985 namespace,1007 namespace,
986 patch_state=PatchState.UNAPPLIED,1008 patch_state=PatchState.UNAPPLIED,
987):1009):
1010 """Find and return any import tags that already exist for the given version
1011
1012 :param GitUbuntuRepository repo: repository to search for import tags
1013 :param str version: the package version string to find
1014 :param str namespace: the name to prefix to the import tag names searched
1015 :param PatchState patch_state: whether to look for unapplied or applied
1016 tags
1017 :rtype: list(pygit2.Reference)
1018 :returns: a list of import tags found. If reimport tags exist, this is the
1019 list of matching reimport tags in order; the original import tag is not
1020 included as it is already represented by the first reimport tag. If
1021 reimport tags do not exist, just the sole import tag is returned. If
1022 none of these are found, the empty list is returned.
1023 """
988 existing_import_tag = repo.get_import_tag(version, namespace, patch_state)1024 existing_import_tag = repo.get_import_tag(version, namespace, patch_state)
989 if existing_import_tag:1025 if existing_import_tag:
990 # check if there are reimports1026 # check if there are reimports; if no import tag exists, then by the
1027 # specification there can be no reimports
991 existing_reimport_tags = repo.get_all_reimport_tags(1028 existing_reimport_tags = repo.get_all_reimport_tags(
992 version,1029 version,
993 namespace,1030 namespace,
994 patch_state,1031 patch_state,
995 )1032 )
996 if existing_reimport_tags:1033 if existing_reimport_tags:
997 return existing_reimport_tags1034 return sorted(
1035 existing_reimport_tags,
1036 # Sort on the integer of the last '/'-separated component
1037 key=lambda tag: int(tag.name.split('/')[-1]),
1038 )
998 else:1039 else:
999 return [existing_import_tag]1040 return [existing_import_tag]
1000 return []1041 return []
@@ -1002,10 +1043,10 @@ def get_existing_import_tags(
10021043
1003def override_parents(parent_overrides, repo, version, namespace):1044def override_parents(parent_overrides, repo, version, namespace):
1004 """1045 """
1005 returns: (unapplied, applied) where both elements of the tuple are commit1046 returns: (unapplied, applied) where both elements of the tuple are lists of
1006 hash strings of the changelog parent to use, incorporating any defined1047 commit hash strings of the changelog parents to use, incorporating any
1007 overrides.1048 defined overrides.
1008 rtype: tuple(str, str)1049 rtype: tuple(list(str), list(str))
1009 """1050 """
1010 unapplied_changelog_parent_commit = None1051 unapplied_changelog_parent_commit = None
1011 applied_changelog_parent_commit = None1052 applied_changelog_parent_commit = None
@@ -1057,8 +1098,8 @@ def override_parents(parent_overrides, repo, version, namespace):
1057 )1098 )
1058 )1099 )
1059 return (1100 return (
1060 unapplied_changelog_parent_commit,1101 [unapplied_changelog_parent_commit],
1061 applied_changelog_parent_commit,1102 [applied_changelog_parent_commit],
1062 )1103 )
10631104
1064def _devel_branch_updates(1105def _devel_branch_updates(
@@ -1296,72 +1337,83 @@ def create_import_tag(repo, commit_hash, version, namespace):
1296 return repo.get_import_tag(version, namespace)1337 return repo.get_import_tag(version, namespace)
12971338
12981339
1299def get_changelog_parent_commit(1340def get_changelog_parent_commits(
1300 repo,1341 repo,
1301 namespace,1342 namespace,
1302 parent_overrides,1343 parent_overrides,
1303 import_tree_versions,1344 import_tree_versions,
1304 patches_applied,1345 patch_state,
1305):1346):
1306 """Walk changelog backwards until we find an imported version,1347 """Given a changelog history, find the changelog parent commits
1307 skipping the current version1348
13081349 "Changelog parents" are defined in the import specification, which refers
1309 :param repo gitubuntu.git_repository.GitUbuntuRepository The1350 to source package data instances. Since this importer runs incrementally in
1310 repository to use1351 Launchpad publication order, the commits associated with the source package
1311 :param parent_overrides dict See parse_parentfile1352 data instances can be located by traversing the matching reimport tags in
1312 :param import_tree_versions list(str) List of versions to iterate.1353 order. If there are no reimport tags, the sole import tag (if it exists)
1313 :param patches_applied bool If true, look for patches-applied1354 will match the sole corresponding source package data instance. Otherwise
1314 imports1355 we find no changelog parent and return an empty list.
13151356
1316 :rtype str1357 This function performs this search and returns a list of commit hashes that
1317 :returns Git commit hash of the nearest (chronologically) imported1358 are the changelog parents.
1318 changelog version1359
1360 :param gitubuntu.git_repository.GitUbuntuRepository repo: the repository to
1361 use
1362 :param dict parent_overrides: see parse_parentfile
1363 :param list(str) import_tree_versions: list of package version strings as
1364 parsed from debian/changelog in the same order
1365 :param PatchState patch_state: whether to look for previous unapplied or
1366 applied imports
1367
1368 :rtype: list(str)
1369 :returns: a list of commit hashes of any existing imports of the changelog
1370 parents as defined by the import specification
1319 """1371 """
1320 # skip current version1372 # skip current version
1321 import_tree_versions = import_tree_versions[1:]1373 import_tree_versions = import_tree_versions[1:]
13221374
1323 for version in import_tree_versions:1375 for version in import_tree_versions:
1324 if patches_applied:1376 changelog_parent_tags = get_existing_import_tags(
1325 changelog_parent_tag = repo.get_import_tag(1377 repo,
1326 version,1378 version,
1327 namespace,1379 namespace,
1328 PatchState.APPLIED,1380 patch_state,
1329 )1381 )
1330 else:
1331 changelog_parent_tag = repo.get_import_tag(
1332 version,
1333 namespace,
1334 PatchState.UNAPPLIED,
1335 ) or repo.get_orphan_tag(
1336 version,
1337 namespace,
1338 )
13391382
1340 if not changelog_parent_tag:1383 if not changelog_parent_tags:
1341 continue1384 continue
13421385
1343 # sanity check that version from d/changelog of the1386 # sanity check that version from d/changelog of the
1344 # tagged parent matches ours1387 # tagged parent matches ours
1345 changelog_parent_version, _ = repo.get_changelog_versions_from_treeish(1388 changelog_parent_versions = [
1346 str(changelog_parent_tag.peel(pygit2.Tree).id)1389 repo.get_changelog_versions_from_treeish(
1347 )1390 str(tag.peel(pygit2.Tree).id)
1391 )[0] for tag in changelog_parent_tags
1392 ]
13481393
1349 # if the parent was imported via a parent override1394 # if the parent was imported via a parent override
1350 # itself, assume it is valid without checking its1395 # itself, assume it is valid without checking its
1351 # tree's debian/changelog, as it wasn't used1396 # tree's debian/changelog, as it wasn't used
1352 if (version in parent_overrides or1397 if (version in parent_overrides or
1353 changelog_parent_version == version1398 any(
1354 ):1399 [changelog_parent_version == version
1355 changelog_parent_commit = str(1400 for changelog_parent_version in changelog_parent_versions]
1356 changelog_parent_tag.peel(pygit2.Commit).id
1357 )1401 )
13581402 ):
1359 logging.debug("Changelog parent (tag) is %s",1403 changelog_parent_commits = [
1360 repo.tag_to_pretty_name(changelog_parent_tag)1404 str(tag.peel(pygit2.Commit).id)
1405 for tag in changelog_parent_tags
1406 ]
1407
1408 logging.debug("Changelog parent(s) (tag(s)) are %s",
1409 [
1410 repo.tag_to_pretty_name(tag)
1411 for tag in changelog_parent_tags
1412 ]
1361 )1413 )
1362 return changelog_parent_commit1414 return changelog_parent_commits
13631415
1364 return None1416 return []
13651417
13661418
1367def import_unapplied_dsc(1419def import_unapplied_dsc(
@@ -1463,7 +1515,6 @@ def import_unapplied_dsc(
14631515
1464 logging.debug('Tip version is %s', unapplied_tip_version)1516 logging.debug('Tip version is %s', unapplied_tip_version)
14651517
1466 unapplied_changelog_parent_commit = None
1467 upload_parent_commit = None1518 upload_parent_commit = None
14681519
1469 if version in parent_overrides:1520 if version in parent_overrides:
@@ -1474,7 +1525,7 @@ def import_unapplied_dsc(
14741525
1475 try:1526 try:
1476 (1527 (
1477 unapplied_changelog_parent_commit,1528 unapplied_changelog_parent_commits,
1478 _1529 _
1479 ) = override_parents(1530 ) = override_parents(
1480 parent_overrides,1531 parent_overrides,
@@ -1494,12 +1545,12 @@ def import_unapplied_dsc(
1494 unapplied_tip_version,1545 unapplied_tip_version,
1495 )1546 )
14961547
1497 unapplied_changelog_parent_commit = get_changelog_parent_commit(1548 unapplied_changelog_parent_commits = get_changelog_parent_commits(
1498 repo,1549 repo,
1499 namespace,1550 namespace,
1500 parent_overrides,1551 parent_overrides,
1501 import_tree_versions,1552 import_tree_versions,
1502 patches_applied=False,1553 patch_state=PatchState.UNAPPLIED,
1503 )1554 )
15041555
1505 # check if the version to import has already been uploaded to1556 # check if the version to import has already been uploaded to
@@ -1515,7 +1566,7 @@ def import_unapplied_dsc(
1515 "does not match the published version. Will orphan commit.",1566 "does not match the published version. Will orphan commit.",
1516 repo.tag_to_pretty_name(existing_import_tag),1567 repo.tag_to_pretty_name(existing_import_tag),
1517 )1568 )
1518 unapplied_changelog_parent_commit = None1569 unapplied_changelog_parent_commits = []
1519 else:1570 else:
1520 repo.update_head_to_commit(1571 repo.update_head_to_commit(
1521 head_name,1572 head_name,
@@ -1549,31 +1600,31 @@ def import_unapplied_dsc(
1549 else:1600 else:
1550 upload_parent_commit = str(existing_upload_tag.peel().id)1601 upload_parent_commit = str(existing_upload_tag.peel().id)
15511602
1552 if unapplied_changelog_parent_commit is not None:1603 if unapplied_changelog_parent_commits:
1553 try:1604 try:
1554 repo.git_run(1605 repo.git_run(
1555 [1606 [
1556 'merge-base',1607 'merge-base',
1557 '--is-ancestor',1608 '--is-ancestor',
1558 unapplied_changelog_parent_commit,1609 unapplied_changelog_parent_commits[0],
1559 upload_parent_commit,1610 upload_parent_commit,
1560 ],1611 ],
1561 verbose_on_failure=False,1612 verbose_on_failure=False,
1562 )1613 )
1563 unapplied_changelog_parent_commit = None1614 unapplied_changelog_parent_commits = []
1564 except CalledProcessError as e:1615 except CalledProcessError as e:
1565 if e.returncode != 1:1616 if e.returncode != 1:
1566 raise1617 raise
15671618
1568 commit_hash = commit_unapplied_patches_import(1619 commit_hash = commit_unapplied_patches_import(
1569 repo,1620 repo=repo,
1570 version,1621 version=version,
1571 head_name,1622 head_name=head_name,
1572 unapplied_import_tree_hash,1623 import_tree_hash=unapplied_import_tree_hash,
1573 namespace,1624 namespace=namespace,
1574 unapplied_changelog_parent_commit,1625 changelog_parent_commits=unapplied_changelog_parent_commits,
1575 upload_parent_commit,1626 upload_parent_commit=upload_parent_commit,
1576 commit_date,1627 commit_date=commit_date,
1577 )1628 )
1578 logging.debug(1629 logging.debug(
1579 "Committed patches-unapplied import of %s as %s in %s",1630 "Committed patches-unapplied import of %s as %s in %s",
@@ -1587,7 +1638,7 @@ def import_unapplied_dsc(
1587 # Not imported before1638 # Not imported before
1588 tag = import_tag(version, namespace)1639 tag = import_tag(version, namespace)
1589 elif (1640 elif (
1590 unapplied_changelog_parent_commit is None and1641 not unapplied_changelog_parent_commits and
1591 upload_parent_commit is None and1642 upload_parent_commit is None and
1592 head_name in repo.local_branch_names1643 head_name in repo.local_branch_names
1593 ):1644 ):
@@ -1726,8 +1777,6 @@ def import_applied_dsc(
17261777
1727 logging.debug('Tip version is %s', applied_tip_version)1778 logging.debug('Tip version is %s', applied_tip_version)
17281779
1729 applied_changelog_parent_commit = None
1730
1731 if version in parent_overrides:1780 if version in parent_overrides:
1732 logging.debug('%s is specified in the parent override file.' %1781 logging.debug('%s is specified in the parent override file.' %
1733 version1782 version
@@ -1735,7 +1784,7 @@ def import_applied_dsc(
17351784
1736 (1785 (
1737 _,1786 _,
1738 applied_changelog_parent_commit,1787 applied_changelog_parent_commits,
1739 ) = override_parents(1788 ) = override_parents(
1740 parent_overrides,1789 parent_overrides,
1741 repo,1790 repo,
@@ -1749,12 +1798,12 @@ def import_applied_dsc(
1749 )1798 )
17501799
17511800
1752 applied_changelog_parent_commit = get_changelog_parent_commit(1801 applied_changelog_parent_commits = get_changelog_parent_commits(
1753 repo,1802 repo,
1754 namespace,1803 namespace,
1755 parent_overrides,1804 parent_overrides,
1756 import_tree_versions,1805 import_tree_versions,
1757 patches_applied=True,1806 patch_state=PatchState.APPLIED,
1758 )1807 )
17591808
1760 existing_applied_tag = repo.get_import_tag(1809 existing_applied_tag = repo.get_import_tag(
@@ -1774,7 +1823,7 @@ def import_applied_dsc(
1774 # "version. Will orphan commit.",1823 # "version. Will orphan commit.",
1775 # repo.tag_to_pretty_name(applied_tag),1824 # repo.tag_to_pretty_name(applied_tag),
1776 # )1825 # )
1777 # applied_changelog_parent_commit = None1826 # applied_changelog_parent_commits = []
1778 #else:1827 #else:
1779 repo.update_head_to_commit(1828 repo.update_head_to_commit(
1780 head_name,1829 head_name,
@@ -1822,14 +1871,14 @@ def import_applied_dsc(
1822 raise1871 raise
18231872
1824 commit_hash = commit_applied_patches_import(1873 commit_hash = commit_applied_patches_import(
1825 repo,1874 repo=repo,
1826 version,1875 version=version,
1827 head_name,1876 head_name=head_name,
1828 applied_import_tree_hash,1877 import_tree_hash=applied_import_tree_hash,
1829 namespace,1878 namespace=namespace,
1830 applied_changelog_parent_commit,1879 changelog_parent_commits=applied_changelog_parent_commits,
1831 str(unapplied_parent_commit),1880 unapplied_parent_commit=str(unapplied_parent_commit),
1832 commit_date,1881 commit_date=commit_date,
1833 )1882 )
1834 logging.debug(1883 logging.debug(
1835 "Committed patches-applied import of %s as %s in %s",1884 "Committed patches-applied import of %s as %s in %s",
@@ -1843,7 +1892,7 @@ def import_applied_dsc(
1843 # Not imported before1892 # Not imported before
1844 tag = import_tag(version, namespace, PatchState.APPLIED)1893 tag = import_tag(version, namespace, PatchState.APPLIED)
1845 elif (1894 elif (
1846 applied_changelog_parent_commit is None and1895 not applied_changelog_parent_commits and
1847 unapplied_parent_commit is None and1896 unapplied_parent_commit is None and
1848 head_name in repo.local_branch_names1897 head_name in repo.local_branch_names
1849 ):1898 ):
diff --git a/gitubuntu/importer_test.py b/gitubuntu/importer_test.py
index b1dcdc3..95744d9 100644
--- a/gitubuntu/importer_test.py
+++ b/gitubuntu/importer_test.py
@@ -73,39 +73,46 @@ def test_get_import_tag_msg():
7373
7474
75@pytest.mark.parametrize(75@pytest.mark.parametrize(
76 'head_name_value, changelog_parent_commit, upload_parent_commit, unapplied_parent_commit, expected',76 'head_name_value, changelog_parent_commits, upload_parent_commit, unapplied_parent_commit, expected',
77 [77 [
78 (78 (
79 'importer/ubuntu/trusty',79 'importer/ubuntu/trusty',
80 None,80 [],
81 None,81 None,
82 None,82 None,
83 b'Import patches-unapplied version 1-1 to ubuntu/trusty\n\nImported using git-ubuntu import.',83 b'Import patches-unapplied version 1-1 to ubuntu/trusty\n\nImported using git-ubuntu import.',
84 ),84 ),
85 (85 (
86 'importer/ubuntu/trusty',86 'importer/ubuntu/trusty',
87 '123456',87 ['123456'],
88 None,88 None,
89 None,89 None,
90 b'Import patches-unapplied version 1-1 to ubuntu/trusty\n\nImported using git-ubuntu import.\n\nChangelog parent: 123456',90 b'Import patches-unapplied version 1-1 to ubuntu/trusty\n\nImported using git-ubuntu import.\n\nChangelog parent: 123456',
91 ),91 ),
92 (92 (
93 'importer/ubuntu/trusty',93 'importer/ubuntu/trusty',
94 None,94 [],
95 '123456',95 '123456',
96 None,96 None,
97 b'Import patches-unapplied version 1-1 to ubuntu/trusty\n\nImported using git-ubuntu import.\n\nUpload parent: 123456',97 b'Import patches-unapplied version 1-1 to ubuntu/trusty\n\nImported using git-ubuntu import.\n\nUpload parent: 123456',
98 ),98 ),
99 (99 (
100 'importer/ubuntu/trusty',100 'importer/ubuntu/trusty',
101 ['123456', '234567'],
102 None,
101 None,103 None,
104 b'Import patches-unapplied version 1-1 to ubuntu/trusty\n\nImported using git-ubuntu import.\n\nChangelog parent: 123456\nChangelog parent: 234567',
105 ),
106 (
107 'importer/ubuntu/trusty',
108 [],
102 None,109 None,
103 '123456',110 '123456',
104 b'Import patches-applied version 1-1 to ubuntu/trusty\n\nImported using git-ubuntu import.\n\nUnapplied parent: 123456',111 b'Import patches-applied version 1-1 to ubuntu/trusty\n\nImported using git-ubuntu import.\n\nUnapplied parent: 123456',
105 ),112 ),
106 (113 (
107 'importer/ubuntu/trusty',114 'importer/ubuntu/trusty',
108 '123456',115 ['123456'],
109 '789123',116 '789123',
110 '456789',117 '456789',
111 b'Import patches-applied version 1-1 to ubuntu/trusty\n\nImported using git-ubuntu import.\n\nChangelog parent: 123456\nUpload parent: 789123\nUnapplied parent: 456789'118 b'Import patches-applied version 1-1 to ubuntu/trusty\n\nImported using git-ubuntu import.\n\nChangelog parent: 123456\nUpload parent: 789123\nUnapplied parent: 456789'
@@ -115,11 +122,30 @@ def test_get_import_tag_msg():
115def test_get_import_commit_msg(122def test_get_import_commit_msg(
116 repo,123 repo,
117 head_name_value,124 head_name_value,
118 changelog_parent_commit,125 changelog_parent_commits,
119 upload_parent_commit,126 upload_parent_commit,
120 unapplied_parent_commit,127 unapplied_parent_commit,
121 expected,128 expected,
122):129):
130 """Test that get_import_commit_msg is generally correct
131
132 This is the general parameterised test for the common case uses of
133 target.get_import_commit_msg.
134
135 This test uses a default source_builder.SourceSpec() to construct a test
136 source tree to provide to get_import_commit_msg, so defaults from
137 SourceSpec() will be used such as a package version string of '1-1'.
138
139 :param GitUbuntuRepository repo: fixture providing a temporary
140 GitUbuntuRepository instance to use
141 :param str head_name_value: passed through to get_import_commit_msg as
142 target_head_name
143 :param list(str) changelog_parent_commits: passed through to
144 get_import_commit_msg
145 :param str upload_parent_commit: passed through to get_import_commit_msg
146 :param str unapplied_parent_commit: passed through to get_import_commit_msg
147 :param bytes expected: the expected return value from get_import_commit_msg
148 """
123 target.get_changelog_for_commit = Mock()149 target.get_changelog_for_commit = Mock()
124 target.get_changelog_for_commit.return_value = b''150 target.get_changelog_for_commit.return_value = b''
125151
@@ -137,22 +163,24 @@ def test_get_import_commit_msg(
137 head_name_value,163 head_name_value,
138 'importer',164 'importer',
139 publish_tree_hash,165 publish_tree_hash,
140 changelog_parent_commit,166 changelog_parent_commits,
141 upload_parent_commit,167 upload_parent_commit,
142 unapplied_parent_commit,168 unapplied_parent_commit,
143 ) == expected169 ) == expected
144170
145171
146@pytest.mark.parametrize(172@pytest.mark.parametrize(
147 'input_repo, expected', [173 'input_repo, patch_state, expected', [
148 (174 (
149 repo_builder.Repo(),175 repo_builder.Repo(),
176 PatchState.UNAPPLIED,
150 [],177 [],
151 ),178 ),
152 (179 (
153 repo_builder.Repo(180 repo_builder.Repo(
154 tags={'importer/import/1-1': repo_builder.Commit()},181 tags={'importer/import/1-1': repo_builder.Commit()},
155 ),182 ),
183 PatchState.UNAPPLIED,
156 ['refs/tags/importer/import/1-1'],184 ['refs/tags/importer/import/1-1'],
157 ),185 ),
158 (186 (
@@ -167,32 +195,22 @@ def test_get_import_commit_msg(
167 'importer/reimport/import/1-1/1': repo_builder.Commit(),195 'importer/reimport/import/1-1/1': repo_builder.Commit(),
168 },196 },
169 ),197 ),
198 PatchState.UNAPPLIED,
170 [199 [
171 'refs/tags/importer/reimport/import/1-1/0',200 'refs/tags/importer/reimport/import/1-1/0',
172 'refs/tags/importer/reimport/import/1-1/1',201 'refs/tags/importer/reimport/import/1-1/1',
173 ],202 ],
174 ),203 ),
175 ],
176)
177def test_get_existing_import_tags(repo, input_repo, expected):
178 input_repo.write(repo.raw_repo)
179
180 assert [
181 ref.name for ref in
182 target.get_existing_import_tags(repo, '1-1', 'importer')
183 ] == expected
184
185
186@pytest.mark.parametrize(
187 'input_repo, expected', [
188 (204 (
189 repo_builder.Repo(),205 repo_builder.Repo(),
206 PatchState.APPLIED,
190 [],207 [],
191 ),208 ),
192 (209 (
193 repo_builder.Repo(210 repo_builder.Repo(
194 tags={'importer/applied/1-1': repo_builder.Commit()},211 tags={'importer/applied/1-1': repo_builder.Commit()},
195 ),212 ),
213 PatchState.APPLIED,
196 ['refs/tags/importer/applied/1-1'],214 ['refs/tags/importer/applied/1-1'],
197 ),215 ),
198 (216 (
@@ -207,6 +225,7 @@ def test_get_existing_import_tags(repo, input_repo, expected):
207 'importer/reimport/applied/1-1/1': repo_builder.Commit(),225 'importer/reimport/applied/1-1/1': repo_builder.Commit(),
208 },226 },
209 ),227 ),
228 PatchState.APPLIED,
210 [229 [
211 'refs/tags/importer/reimport/applied/1-1/0',230 'refs/tags/importer/reimport/applied/1-1/0',
212 'refs/tags/importer/reimport/applied/1-1/1',231 'refs/tags/importer/reimport/applied/1-1/1',
@@ -214,18 +233,78 @@ def test_get_existing_import_tags(repo, input_repo, expected):
214 ),233 ),
215 ],234 ],
216)235)
217def test_get_existing_applied_tags(repo, input_repo, expected):236def test_get_existing_import_tags(repo, patch_state, input_repo, expected):
237 """Test that get_existing_import_tags is generally correct
238
239 This is the general parameterised test for the common case uses of
240 target.get_existing_import_tags.
241
242 :param repo gitubuntu.git_repository.GitUbuntuRepository: fixture to hold a
243 temporary output repository
244 :param PatchState patch_state: passed through to get_existing_import_tags
245 :param repo_builder.Repo input_repo: input repository data
246 :param list(str) expected: the names of the references that are expected to
247 be returned, in order.
248 """
218 input_repo.write(repo.raw_repo)249 input_repo.write(repo.raw_repo)
219250
220 assert [251 assert [
221 ref.name for ref in252 ref.name for ref in
222 target.get_existing_import_tags(253 target.get_existing_import_tags(repo, '1-1', 'importer', patch_state)
223 repo,254 ] == expected
255
256
257def test_get_existing_import_tags_ordering(repo):
258 """Test that get_existing_import_tags returns results in the correct order
259
260 To maintain hash stability, the spec defines that multiple changelog
261 parents must appear in the order that they were published. For this to
262 work, get_existing_import_tags must return the tags in the correct order
263 even if the underlying git repository tags appear in an arbitrary order.
264
265 :param GitUbuntuRepository repo: fixture of a temporary repository to use
266 """
267
268 # Construct a synthetic git repository containing tags
269 repo_builder.Repo(
270 tags={
271 'importer/import/1-1': repo_builder.Commit(),
272 'importer/reimport/import/1-1/0': repo_builder.Commit(),
273 'importer/reimport/import/1-1/1': repo_builder.Commit(),
274 }
275 ).write(repo.raw_repo)
276
277 mock_get_all_reimport_tags_patch = patch.object(
278 repo,
279 'get_all_reimport_tags',
280 autospec=True,
281 )
282 with mock_get_all_reimport_tags_patch as mock_get_all_reimport_tags:
283 # Intentionally arrange for repo.get_all_reimport_tags to return the
284 # expected result but in reverse order
285 mock_get_all_reimport_tags.return_value = [
286 repo.raw_repo.lookup_reference('refs/tags/%s' % name)
287 for name in [
288 'importer/reimport/import/1-1/1',
289 'importer/reimport/import/1-1/0',
290 ]
291 ]
292
293 # Call function under test
294 tags = target.get_existing_import_tags(repo, '1-1', 'importer')
295
296 # Check that our mock was called as expected
297 mock_get_all_reimport_tags.assert_called_once_with(
224 '1-1',298 '1-1',
225 'importer',299 'importer',
226 PatchState.APPLIED,300 PatchState.UNAPPLIED,
227 )301 )
228 ] == expected302
303 # Result tags should be in numeric order
304 assert [ref.name for ref in tags] == [
305 'refs/tags/importer/reimport/import/1-1/0',
306 'refs/tags/importer/reimport/import/1-1/1',
307 ]
229308
230309
231@pytest.mark.parametrize(310@pytest.mark.parametrize(
@@ -442,16 +521,16 @@ def test_create_applied_tag(
442 'input_repo',521 'input_repo',
443 'parent_overrides',522 'parent_overrides',
444 'changelog_versions',523 'changelog_versions',
445 'patches_applied',524 'patch_state',
446 'expected_ref',525 'expected_refs',
447 ],526 ],
448 [527 [
449 (528 (
450 repo_builder.Repo(),529 repo_builder.Repo(),
451 {},530 {},
452 ['1-2', '1-1',],531 ['1-2', '1-1',],
453 False,532 PatchState.UNAPPLIED,
454 None,533 [],
455 ),534 ),
456 (535 (
457 repo_builder.Repo(536 repo_builder.Repo(
@@ -460,8 +539,28 @@ def test_create_applied_tag(
460 ),539 ),
461 {},540 {},
462 ['1-2', '1-1'],541 ['1-2', '1-1'],
463 False,542 PatchState.UNAPPLIED,
464 'refs/tags/importer/import/1-1',543 ['refs/tags/importer/import/1-1'],
544 ),
545 (
546 repo_builder.Repo(
547 commits=[
548 repo_builder.Commit.from_spec(name='import'),
549 repo_builder.Commit.from_spec(name='reimport', mutate=1),
550 ],
551 tags={
552 'importer/import/1-1': Placeholder('import'),
553 'importer/reimport/import/1-1/0': Placeholder('import'),
554 'importer/reimport/import/1-1/1': Placeholder('reimport'),
555 },
556 ),
557 {},
558 ['1-2', '1-1'],
559 PatchState.UNAPPLIED,
560 [
561 'refs/tags/importer/reimport/import/1-1/0',
562 'refs/tags/importer/reimport/import/1-1/1',
563 ],
465 ),564 ),
466 (565 (
467 repo_builder.Repo(566 repo_builder.Repo(
@@ -470,15 +569,15 @@ def test_create_applied_tag(
470 ),569 ),
471 {},570 {},
472 ['1-3', '1-2', '1-1'],571 ['1-3', '1-2', '1-1'],
473 False,572 PatchState.UNAPPLIED,
474 'refs/tags/importer/import/1-1',573 ['refs/tags/importer/import/1-1'],
475 ),574 ),
476 (575 (
477 repo_builder.Repo(),576 repo_builder.Repo(),
478 {},577 {},
479 ['1-2', '1-1',],578 ['1-2', '1-1',],
480 True,579 PatchState.APPLIED,
481 None,580 [],
482 ),581 ),
483 (582 (
484 repo_builder.Repo(583 repo_builder.Repo(
@@ -487,8 +586,28 @@ def test_create_applied_tag(
487 ),586 ),
488 {},587 {},
489 ['1-2', '1-1'],588 ['1-2', '1-1'],
490 True,589 PatchState.APPLIED,
491 'refs/tags/importer/applied/1-1',590 ['refs/tags/importer/applied/1-1'],
591 ),
592 (
593 repo_builder.Repo(
594 commits=[
595 repo_builder.Commit.from_spec(name='import'),
596 repo_builder.Commit.from_spec(name='reimport', mutate=1),
597 ],
598 tags={
599 'importer/applied/1-1': Placeholder('import'),
600 'importer/reimport/applied/1-1/0': Placeholder('import'),
601 'importer/reimport/applied/1-1/1': Placeholder('reimport'),
602 },
603 ),
604 {},
605 ['1-2', '1-1'],
606 PatchState.APPLIED,
607 [
608 'refs/tags/importer/reimport/applied/1-1/0',
609 'refs/tags/importer/reimport/applied/1-1/1',
610 ],
492 ),611 ),
493 (612 (
494 repo_builder.Repo(613 repo_builder.Repo(
@@ -497,30 +616,51 @@ def test_create_applied_tag(
497 ),616 ),
498 {},617 {},
499 ['1-3', '1-2', '1-1'],618 ['1-3', '1-2', '1-1'],
500 True,619 PatchState.APPLIED,
501 'refs/tags/importer/applied/1-1',620 ['refs/tags/importer/applied/1-1'],
502 ),621 ),
503 ],622 ],
504)623)
505def test_get_changelog_parent_commit(624def test_get_changelog_parent_commits(
506 repo,625 repo,
507 input_repo,626 input_repo,
508 parent_overrides,627 parent_overrides,
509 changelog_versions,628 changelog_versions,
510 patches_applied,629 patch_state,
511 expected_ref,630 expected_refs,
512):631):
632 """Test that get_changelog_parent_commits is generally correct
633
634 This is the general parameterised test for the common case uses of
635 target.get_changelog_parent_commits.
636
637 :param GitUbuntuRepository repo: fixture providing a temporary
638 GitUbuntuRepository instance to use
639 :param repo_builder.Repo input_repo: the input repository data to use that
640 will be populated into @repo before @repo is passed through to
641 get_changelog_parent_commits
642 :param dict parent_overrides: passed through to
643 get_changelog_parent_commits.
644 :param PatchState patch_state: passed through to
645 get_changelog_parent_commits
646 :param list(str) expected_refs: the expected return value of
647 get_changelog_parent_commits expressed using a list of reference names.
648 Since get_changelog_parent_commits returns a list of commit hash
649 strings, the reference names will need to be dereferenced before
650 comparison; this way the test parameters don't need to be opaque hash
651 strings.
652 """
513 input_repo.write(repo.raw_repo)653 input_repo.write(repo.raw_repo)
514 assert target.get_changelog_parent_commit(654 assert target.get_changelog_parent_commits(
515 repo,655 repo,
516 'importer',656 'importer',
517 parent_overrides,657 parent_overrides,
518 changelog_versions,658 changelog_versions,
519 patches_applied,659 patch_state,
520 ) == (660 ) == ([
521 str(repo.raw_repo.lookup_reference(expected_ref).peel(pygit2.Commit).id)661 str(repo.raw_repo.lookup_reference(expected_ref).peel(pygit2.Commit).id)
522 if expected_ref else expected_ref662 for expected_ref in expected_refs
523 )663 ])
524664
525@patch('gitubuntu.git_repository.GitUbuntuRepository.add_base_remotes')665@patch('gitubuntu.git_repository.GitUbuntuRepository.add_base_remotes')
526def test_importer_main_cleanup_on_exception(add_base_remotes_mock):666def test_importer_main_cleanup_on_exception(add_base_remotes_mock):
@@ -703,6 +843,19 @@ def test_import_unapplied_spi_quilt_patches(
703 ],843 ],
704 [844 [
705 pytest.param(845 pytest.param(
846 repo_builder.Repo(),
847 ['1-1'],
848 {
849 'add_commits': [
850 repo_builder.Commit.from_spec(name='publish'),
851 ],
852 'update_tags': {'importer/import/1-1': Placeholder('publish')},
853 },
854 [
855 'refs/tags/importer/import/1-1',
856 ]
857 ),
858 pytest.param(
706 repo_builder.Repo(859 repo_builder.Repo(
707 commits=[repo_builder.Commit.from_spec(name='import')],860 commits=[repo_builder.Commit.from_spec(name='import')],
708 tags={'importer/import/1-1': Placeholder('import')},861 tags={'importer/import/1-1': Placeholder('import')},
@@ -744,7 +897,7 @@ def test_import_unapplied_spi_quilt_patches(
744 'refs/tags/importer/import/1-3',897 'refs/tags/importer/import/1-3',
745 ],898 ],
746 ),899 ),
747 pytest.param(900 (
748 repo_builder.Repo(901 repo_builder.Repo(
749 commits=[902 commits=[
750 repo_builder.Commit.from_spec(name='import'),903 repo_builder.Commit.from_spec(name='import'),
@@ -779,7 +932,6 @@ def test_import_unapplied_spi_quilt_patches(
779 'refs/tags/importer/reimport/import/1-1/1',932 'refs/tags/importer/reimport/import/1-1/1',
780 'refs/tags/importer/import/1-2',933 'refs/tags/importer/import/1-2',
781 ],934 ],
782 marks=pytest.mark.xfail(reason='LP: #1761332'),
783 ),935 ),
784 ]936 ]
785)937)

Subscribers

People subscribed via source and target branches