patch-manager 0.0.8__tar.gz → 0.0.10__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 (56) hide show
  1. {patch_manager-0.0.8 → patch_manager-0.0.10}/PKG-INFO +8 -1
  2. {patch_manager-0.0.8 → patch_manager-0.0.10}/README.rst +7 -0
  3. {patch_manager-0.0.8 → patch_manager-0.0.10}/patch_manager.egg-info/PKG-INFO +8 -1
  4. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/cser_helper.py +33 -15
  5. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/cseries.py +7 -6
  6. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/func_test.py +3 -3
  7. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/patman.rst +23 -35
  8. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/status.py +3 -2
  9. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/test_common.py +3 -3
  10. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/test_cseries.py +26 -9
  11. {patch_manager-0.0.8 → patch_manager-0.0.10}/pyproject.toml +1 -1
  12. {patch_manager-0.0.8 → patch_manager-0.0.10}/LICENSE +0 -0
  13. {patch_manager-0.0.8 → patch_manager-0.0.10}/patch_manager.egg-info/SOURCES.txt +0 -0
  14. {patch_manager-0.0.8 → patch_manager-0.0.10}/patch_manager.egg-info/dependency_links.txt +0 -0
  15. {patch_manager-0.0.8 → patch_manager-0.0.10}/patch_manager.egg-info/entry_points.txt +0 -0
  16. {patch_manager-0.0.8 → patch_manager-0.0.10}/patch_manager.egg-info/requires.txt +0 -0
  17. {patch_manager-0.0.8 → patch_manager-0.0.10}/patch_manager.egg-info/top_level.txt +0 -0
  18. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/__init__.py +0 -0
  19. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/__main__.py +0 -0
  20. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/checkpatch.py +0 -0
  21. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/cmdline.py +0 -0
  22. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/commit.py +0 -0
  23. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/control.py +0 -0
  24. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/database.py +0 -0
  25. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/get_maintainer.py +0 -0
  26. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/gmail.py +0 -0
  27. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/patchstream.py +0 -0
  28. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/patchwork.py +0 -0
  29. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/project.py +0 -0
  30. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/review.py +0 -0
  31. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/send.py +0 -0
  32. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/series.py +0 -0
  33. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/settings.py +0 -0
  34. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/test/0000-cover-letter.patch +0 -0
  35. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/test/0001-pci-Correct-cast-for-sandbox.patch +0 -0
  36. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/test/0002-fdt-Correct-cast-for-sandbox-in-fdtdec_setup_mem_siz.patch +0 -0
  37. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/test/get_maintainer +0 -0
  38. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/test/maintainers +0 -0
  39. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/test/test01.txt +0 -0
  40. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/test_checkpatch.py +0 -0
  41. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/test_settings.py +0 -0
  42. {patch_manager-0.0.8 → patch_manager-0.0.10}/patman/workflow.py +0 -0
  43. {patch_manager-0.0.8 → patch_manager-0.0.10}/setup.cfg +0 -0
  44. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/__init__.py +0 -0
  45. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/__main__.py +0 -0
  46. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/claude.py +0 -0
  47. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/command.py +0 -0
  48. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/cros_subprocess.py +0 -0
  49. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/gitutil.py +0 -0
  50. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/terminal.py +0 -0
  51. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/test_claude.py +0 -0
  52. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/test_command.py +0 -0
  53. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/test_gitutil.py +0 -0
  54. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/test_util.py +0 -0
  55. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/tools.py +0 -0
  56. {patch_manager-0.0.8 → patch_manager-0.0.10}/u_boot_pylib/tout.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patch-manager
3
- Version: 0.0.8
3
+ Version: 0.0.10
4
4
  Summary: Create, check and email patch series, with Patchwork integration
5
5
  Author-email: Simon Glass <sjg@chromium.org>
6
6
  License-Expression: GPL-2.0-or-later
@@ -111,6 +111,13 @@ The suite is self-contained: a pinned ``checkpatch.pl`` and its helper files
111
111
  live in ``scripts/``, and the bundled ``u_boot_pylib`` package is vendored in
112
112
  the tree, so no surrounding U-Boot source is required.
113
113
 
114
+ Build the documentation locally with::
115
+
116
+ pip install -r doc/requirements.txt
117
+ make -C doc html
118
+
119
+ The rendered HTML is written to ``doc/_build/html``.
120
+
114
121
  License
115
122
  -------
116
123
 
@@ -74,6 +74,13 @@ The suite is self-contained: a pinned ``checkpatch.pl`` and its helper files
74
74
  live in ``scripts/``, and the bundled ``u_boot_pylib`` package is vendored in
75
75
  the tree, so no surrounding U-Boot source is required.
76
76
 
77
+ Build the documentation locally with::
78
+
79
+ pip install -r doc/requirements.txt
80
+ make -C doc html
81
+
82
+ The rendered HTML is written to ``doc/_build/html``.
83
+
77
84
  License
78
85
  -------
79
86
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patch-manager
3
- Version: 0.0.8
3
+ Version: 0.0.10
4
4
  Summary: Create, check and email patch series, with Patchwork integration
5
5
  Author-email: Simon Glass <sjg@chromium.org>
6
6
  License-Expression: GPL-2.0-or-later
@@ -111,6 +111,13 @@ The suite is self-contained: a pinned ``checkpatch.pl`` and its helper files
111
111
  live in ``scripts/``, and the bundled ``u_boot_pylib`` package is vendored in
112
112
  the tree, so no surrounding U-Boot source is required.
113
113
 
114
+ Build the documentation locally with::
115
+
116
+ pip install -r doc/requirements.txt
117
+ make -C doc html
118
+
119
+ The rendered HTML is written to ``doc/_build/html``.
120
+
114
121
  License
115
122
  -------
116
123
 
@@ -651,7 +651,8 @@ class CseriesHelper:
651
651
  ser.name = name
652
652
  return ser
653
653
 
654
- def _parse_series_and_version(self, in_name, in_version):
654
+ def _parse_series_and_version(self, in_name, in_version,
655
+ include_archived=False):
655
656
  """Parse name and version of a series, or detect from current branch
656
657
 
657
658
  Figures out the name from in_name, or if that is None, from the current
@@ -663,6 +664,7 @@ class CseriesHelper:
663
664
  Args:
664
665
  in_name (str or None): name of series
665
666
  in_version (str or None): version of series
667
+ include_archived (bool): True to also find archived series
666
668
 
667
669
  Return:
668
670
  tuple:
@@ -690,7 +692,7 @@ class CseriesHelper:
690
692
  version = 1
691
693
  if version > 99:
692
694
  raise ValueError(f"Version {version} exceeds 99")
693
- ser = self.get_series_by_name(name)
695
+ ser = self.get_series_by_name(name, include_archived)
694
696
  if not ser:
695
697
  ser = Series()
696
698
  ser.name = name
@@ -833,7 +835,7 @@ class CseriesHelper:
833
835
  if not quiet:
834
836
  tout.info(
835
837
  f'Checking out upstream commit {upstream_name}: '
836
- f'{oid(commit.oid)}')
838
+ f'{oid(commit.id)}')
837
839
 
838
840
  old_head = repo.head
839
841
  if old_head.shorthand == name:
@@ -843,7 +845,7 @@ class CseriesHelper:
843
845
 
844
846
  if new_name:
845
847
  name = new_name
846
- repo.set_head(commit.oid)
848
+ repo.set_head(commit.id)
847
849
 
848
850
  commits = []
849
851
  cmt = repo.get(branch.target)
@@ -879,7 +881,7 @@ class CseriesHelper:
879
881
 
880
882
  tree_id = repo.index.write_tree()
881
883
  cherry = repo.get(cmt.hash)
882
- tout.detail(f"cherry {oid(cherry.oid)}")
884
+ tout.detail(f"cherry {oid(cherry.id)}")
883
885
  return tree_id, cherry
884
886
 
885
887
  def _finish_commit(self, repo, tree_id, commit, cur, msg=None):
@@ -927,12 +929,12 @@ class CseriesHelper:
927
929
  target = repo.revparse_single('HEAD')
928
930
  if not quiet:
929
931
  tout.info(f'Updating branch {name} from {oid(branch.target)} to '
930
- f'{str(target.oid)[:HASH_LEN]}')
932
+ f'{str(target.id)[:HASH_LEN]}')
931
933
  if dry_run:
932
934
  if new_name:
933
935
  repo.head.set_target(branch.target)
934
936
  else:
935
- branch_oid = branch.peel(pygit2.enums.ObjectType.COMMIT).oid
937
+ branch_oid = branch.peel(pygit2.enums.ObjectType.COMMIT).id
936
938
  repo.head.set_target(branch_oid)
937
939
  repo.head.set_target(branch.target)
938
940
  repo.set_head(branch.name)
@@ -989,7 +991,7 @@ class CseriesHelper:
989
991
  name, count, quiet=True)
990
992
  repo.checkout_tree(commit, strategy=CheckoutStrategy.FORCE |
991
993
  CheckoutStrategy.RECREATE_MISSING)
992
- repo.set_head(commit.oid)
994
+ repo.set_head(commit.id)
993
995
  for seq, cmt in enumerate(series.commits):
994
996
  if seq != seq_to_drop:
995
997
  tree_id, cherry = self._pick_commit(repo, cmt)
@@ -1058,7 +1060,7 @@ class CseriesHelper:
1058
1060
  tout.info(f'- {info.ljust(max_len)} {rest}')
1059
1061
  target = self._finish_process(repo, branch, name, cur, old_head,
1060
1062
  new_name, switch, dry_run)
1061
- vals.oid = target.oid
1063
+ vals.oid = target.id
1062
1064
 
1063
1065
  def _mark_series(self, name, series, dry_run=False):
1064
1066
  """Mark a series with Change-Id tags
@@ -1204,12 +1206,14 @@ class CseriesHelper:
1204
1206
  col_state = self.col.build(col, prefix + out, bright)
1205
1207
  return col_state, pad
1206
1208
 
1207
- def _get_patches(self, series, version):
1209
+ def _get_patches(self, series, version, include_archived=False):
1208
1210
  """Get a Series object containing the patches in a series
1209
1211
 
1210
1212
  Args:
1211
1213
  series (str): Name of series to use, or None to use current branch
1212
1214
  version (int): Version number, or None to detect from name
1215
+ include_archived (bool): True to also find archived series, reading
1216
+ their patches from the archive tag rather than the branch
1213
1217
 
1214
1218
  Return: tuple:
1215
1219
  str: Name of branch, e.g. 'mary2'
@@ -1223,7 +1227,8 @@ class CseriesHelper:
1223
1227
  str: cover_id
1224
1228
  int: cover_num_comments
1225
1229
  """
1226
- ser, version = self._parse_series_and_version(series, version)
1230
+ ser, version = self._parse_series_and_version(series, version,
1231
+ include_archived)
1227
1232
  if not ser.idnum:
1228
1233
  raise ValueError(f"Unknown series '{series}'")
1229
1234
  self._ensure_version(ser, version)
@@ -1232,7 +1237,10 @@ class CseriesHelper:
1232
1237
 
1233
1238
  count = len(pwc)
1234
1239
  branch = self._join_name_version(ser.name, version)
1235
- series = patchstream.get_metadata(branch, 0, count,
1240
+ # An archived series has no branch; read its patches from the
1241
+ # archive tag instead
1242
+ ref = svinfo.archive_tag if svinfo.archive_tag else branch
1243
+ series = patchstream.get_metadata(ref, 0, count,
1236
1244
  git_dir=self.gitdir)
1237
1245
  self._copy_db_fields_to(series, ser)
1238
1246
 
@@ -1389,14 +1397,24 @@ class CseriesHelper:
1389
1397
  if gather_tags:
1390
1398
  count = len(pwc)
1391
1399
  branch = self._join_name_version(series_name, version)
1392
- series = patchstream.get_metadata(branch, 0, count,
1400
+ # An archived series has no branch: read its patches from the
1401
+ # archive tag, and do not try to write gathered tags back into
1402
+ # a branch that no longer exists
1403
+ svrec = self.get_ser_ver_dict().get(svid)
1404
+ archived = bool(svrec and svrec.archive_tag)
1405
+ ref = svrec.archive_tag if archived else branch
1406
+ series = patchstream.get_metadata(ref, 0, count,
1393
1407
  git_dir=self.gitdir)
1394
1408
 
1395
1409
  _, new_rtag_list = status.do_show_status(
1396
1410
  series, cover, patches, show_comments, show_cover_comments,
1397
1411
  self.col, warnings_on_stderr=False)
1398
- self.update_series(branch, series, version, None, dry_run,
1399
- add_rtags=new_rtag_list)
1412
+ if archived:
1413
+ tout.info(f"Series '{series_name}' is archived: "
1414
+ 'not updating commit tags')
1415
+ else:
1416
+ self.update_series(branch, series, version, None, dry_run,
1417
+ add_rtags=new_rtag_list)
1400
1418
 
1401
1419
  updated = 0
1402
1420
  for seq, item in enumerate(pwc.values()):
@@ -212,7 +212,7 @@ class Cseries(cser_helper.CseriesHelper):
212
212
 
213
213
  del_name = f'{ser.name}{max_vers}'
214
214
  del_branch = repo.lookup_branch(del_name)
215
- branch_oid = del_branch.peel(pygit2.enums.ObjectType.COMMIT).oid
215
+ branch_oid = del_branch.peel(pygit2.enums.ObjectType.COMMIT).id
216
216
  del_branch.delete()
217
217
  tout.info(f"Deleted branch '{del_name}' {oid(branch_oid)}")
218
218
 
@@ -1347,7 +1347,7 @@ class Cseries(cser_helper.CseriesHelper):
1347
1347
  repo = pygit2.Repository(self.gitdir)
1348
1348
  for _, (idnum, name, tag_name) in tag_info.items():
1349
1349
  commit = repo.revparse_single(name)
1350
- repo.create_tag(tag_name, commit.hex,
1350
+ repo.create_tag(tag_name, str(commit.id),
1351
1351
  pygit2.enums.ObjectType.COMMIT,
1352
1352
  commit.author, commit.message)
1353
1353
 
@@ -1364,8 +1364,8 @@ class Cseries(cser_helper.CseriesHelper):
1364
1364
 
1365
1365
  # Detach HEAD from the branch if pointing to this branch
1366
1366
  commit = repo.revparse_single(name)
1367
- if repo.head.target == commit.oid:
1368
- repo.set_head(commit.oid)
1367
+ if repo.head.target == commit.id:
1368
+ repo.set_head(commit.id)
1369
1369
 
1370
1370
  repo.branches.delete(name)
1371
1371
 
@@ -1431,7 +1431,7 @@ class Cseries(cser_helper.CseriesHelper):
1431
1431
  show_cover_comments (bool): Show all comments on the cover letter
1432
1432
  """
1433
1433
  branch, series, version, _, _, link, _, _ = self._get_patches(
1434
- series, version)
1434
+ series, version, include_archived=True)
1435
1435
  if not link:
1436
1436
  raise ValueError(
1437
1437
  f"Series '{series.name}' v{version} has no patchwork link: "
@@ -1470,7 +1470,8 @@ class Cseries(cser_helper.CseriesHelper):
1470
1470
  gather_tags (bool): True to gather review/test tags
1471
1471
  dry_run (bool): True to do a dry run (database is not updated)
1472
1472
  """
1473
- ser, version = self._parse_series_and_version(series, version)
1473
+ ser, version = self._parse_series_and_version(
1474
+ series, version, include_archived=True)
1474
1475
  self._ensure_version(ser, version)
1475
1476
  svid, link = self._get_series_svid_link(ser.idnum, version)
1476
1477
  if not link:
@@ -393,7 +393,7 @@ Changes in v2:
393
393
  target = repo.lookup_reference('refs/heads/first')
394
394
  # pylint doesn't seem to find this
395
395
  # pylint: disable=E1101
396
- self.repo.checkout(target, strategy=pygit2.GIT_CHECKOUT_FORCE)
396
+ self.repo.checkout(target, strategy=pygit2.enums.CheckoutStrategy.FORCE)
397
397
  control.setup()
398
398
  orig_dir = os.getcwd()
399
399
  try:
@@ -443,7 +443,7 @@ Changes in v2:
443
443
  cover_lines = cover.splitlines()
444
444
  sig_pos = cover_lines.index('-- ')
445
445
  base2 = repo.lookup_reference('refs/heads/second')
446
- ref = base2.peel(pygit2.GIT_OBJ_COMMIT).parents[0].parents[0].id
446
+ ref = base2.peel(pygit2.enums.ObjectType.COMMIT).parents[0].parents[0].id
447
447
  self.assertEqual(f'base-commit: {ref}', cover_lines[sig_pos - 3])
448
448
  self.assertEqual('branch: second', cover_lines[sig_pos - 2])
449
449
  finally:
@@ -603,7 +603,7 @@ diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
603
603
  target = repo.lookup_reference('refs/heads/base')
604
604
  # pylint doesn't seem to find this
605
605
  # pylint: disable=E1101
606
- self.repo.checkout(target, strategy=pygit2.GIT_CHECKOUT_FORCE)
606
+ self.repo.checkout(target, strategy=pygit2.enums.CheckoutStrategy.FORCE)
607
607
 
608
608
  # Check that it can detect the current branch
609
609
  orig_dir = os.getcwd()
@@ -25,8 +25,10 @@ It also has some Patchwork features:
25
25
  - List comments received on a series
26
26
 
27
27
  It is intended to automate patch creation and make it a less
28
- error-prone process. It is useful for U-Boot and Linux work so far,
29
- since they use the checkpatch.pl script.
28
+ error-prone process. It works with any git project that sends patches
29
+ by email. The checkpatch and get_maintainer steps follow the U-Boot
30
+ and Linux kernel conventions and can be skipped for projects that do
31
+ not use them.
30
32
 
31
33
  It is configured almost entirely by tags it finds in your commits.
32
34
  This means that you can work on a number of different branches at
@@ -51,8 +53,7 @@ You can install patman using::
51
53
 
52
54
  The name is chosen since patman conflicts with an existing package.
53
55
 
54
- If you are using patman within the U-Boot tree, it may be easiest to add a
55
- symlink from your local `~/.bin` directory to `/path/to/tools/patman/patman`.
56
+ The source code is hosted at https://github.com/nxtboot/patman
56
57
 
57
58
  How to use this tool
58
59
  --------------------
@@ -75,17 +76,17 @@ This tool requires a certain way of working:
75
76
  How to configure it
76
77
  -------------------
77
78
 
78
- For most cases of using patman for U-Boot development, patman can use the
79
- file 'doc/git-mailrc' in your U-Boot directory to supply the email aliases
80
- you need. To make this work, tell git where to find the file by typing
81
- this once::
79
+ If your project ships a git mail-alias file (U-Boot, for example,
80
+ provides 'doc/git-mailrc'), patman can use it to supply the email
81
+ aliases you need. To make this work, tell git where to find the file
82
+ by typing this once::
82
83
 
83
84
  git config sendemail.aliasesfile doc/git-mailrc
84
85
 
85
- For both Linux and U-Boot the 'scripts/get_maintainer.pl' handles
86
- figuring out where to send patches pretty well. For other projects,
87
- you may want to specify a different script to be run, for example via
88
- a project-specific `.patman` file::
86
+ Projects in the U-Boot and Linux kernel style provide a
87
+ 'scripts/get_maintainer.pl' that works out where to send patches. For
88
+ other projects, you may want to specify a different script to be run,
89
+ for example via a project-specific `.patman` file::
89
90
 
90
91
  # .patman configuration file at the root of some project
91
92
 
@@ -122,8 +123,9 @@ file take precedence over those of the "global" one.
122
123
 
123
124
  Aliases are recursive.
124
125
 
125
- The checkpatch.pl in the U-Boot tools/ subdirectory will be located and
126
- used. Failing that you can put it into your path or ~/bin/checkpatch.pl
126
+ If the project provides a checkpatch.pl (in its 'scripts/' or 'tools/'
127
+ directory, as U-Boot and Linux do) patman will locate and use it.
128
+ Failing that you can put it into your path or ~/bin/checkpatch.pl
127
129
 
128
130
  If you want to avoid sending patches to email addresses that are picked up
129
131
  by patman but are known to bounce you can add a [bounces] section to your
@@ -162,39 +164,26 @@ First do a dry run:
162
164
 
163
165
  .. code-block:: bash
164
166
 
165
- ./tools/patman/patman send -n
167
+ patman send -n
166
168
 
167
169
  If it can't detect the upstream branch, try telling it how many patches
168
170
  there are in your series
169
171
 
170
172
  .. code-block:: bash
171
173
 
172
- ./tools/patman/patman -c5 send -n
174
+ patman -c5 send -n
173
175
 
174
176
  This will create patch files in your current directory and tell you who
175
177
  it is thinking of sending them to. Take a look at the patch files:
176
178
 
177
179
  .. code-block:: bash
178
180
 
179
- ./tools/patman/patman -c5 -s1 send -n
181
+ patman -c5 -s1 send -n
180
182
 
181
183
  Similar to the above, but skip the first commit and take the next 5. This
182
184
  is useful if your top commit is for setting up testing.
183
185
 
184
186
 
185
- How to install it
186
- -----------------
187
-
188
- The most up to date version of patman can be found in the U-Boot sources.
189
- However to use it on other projects it may be more convenient to install it as
190
- a standalone application. A distutils installer is included, this can be used
191
- to install patman:
192
-
193
- .. code-block:: bash
194
-
195
- cd tools/patman && python setup.py install
196
-
197
-
198
187
  How to add tags
199
188
  ---------------
200
189
 
@@ -1191,17 +1180,16 @@ them:
1191
1180
 
1192
1181
  .. code-block:: bash
1193
1182
 
1194
- $ tools/patman/patman test
1183
+ $ patman test
1195
1184
 
1196
- Note that since the test suite depends on data files only available in
1197
- the git checkout, the `test` command is hidden unless `patman` is
1198
- invoked from the U-Boot git repository.
1185
+ The `test` command is only shown when the test data files are present;
1186
+ they ship with the source checkout and the installed package.
1199
1187
 
1200
1188
  Alternatively, you can run the test suite via Pytest:
1201
1189
 
1202
1190
  .. code-block:: bash
1203
1191
 
1204
- $ cd tools/patman && pytest
1192
+ $ pytest
1205
1193
 
1206
1194
  Error handling doesn't always produce friendly error messages - e.g.
1207
1195
  putting an incorrect tag in a commit may provide a confusing message.
@@ -191,10 +191,11 @@ def create_branch(series, new_rtag_list, branch, dest_branch, overwrite,
191
191
  parent = repo.branches.get(dest_branch)
192
192
  cherry = repo.revparse_single('%s~%d' % (branch, count - seq - 1))
193
193
 
194
- repo.merge_base(cherry.oid, parent.target)
194
+ repo.merge_base(cherry.id, parent.target)
195
195
  base_tree = cherry.parents[0].tree
196
196
 
197
- index = repo.merge_trees(base_tree, parent, cherry)
197
+ index = repo.merge_trees(
198
+ base_tree, repo[parent.target].tree, cherry.tree)
198
199
  tree_id = index.write_tree(repo)
199
200
 
200
201
  lines = []
@@ -177,7 +177,7 @@ better than before''')
177
177
  target = repo.revparse_single('HEAD~2')
178
178
  # pylint doesn't seem to find this
179
179
  # pylint: disable=E1101
180
- repo.reset(target.oid, pygit2.enums.ResetMode.HARD)
180
+ repo.reset(target.id, pygit2.enums.ResetMode.HARD)
181
181
  self.make_commit_with_file('video: Some video improvements', '''
182
182
  Fix up the video so that
183
183
  it looks more purple. Purple is
@@ -247,9 +247,9 @@ and a little more''')
247
247
  'refs/heads/second')
248
248
 
249
249
  target = repo.lookup_reference('refs/heads/first')
250
- repo.checkout(target, strategy=pygit2.GIT_CHECKOUT_FORCE)
250
+ repo.checkout(target, strategy=pygit2.enums.CheckoutStrategy.FORCE)
251
251
  target = repo.revparse_single('HEAD')
252
- repo.reset(target.oid, pygit2.enums.ResetMode.HARD)
252
+ repo.reset(target.id, pygit2.enums.ResetMode.HARD)
253
253
 
254
254
  self.assertFalse(gitutil.check_dirty(self.gitdir, self.tmpdir))
255
255
  return repo
@@ -908,9 +908,9 @@ Tested-by: Mary Smith <msmith@wibble.com> # yak
908
908
 
909
909
  repo = pygit2.init_repository(self.gitdir)
910
910
  first = repo.lookup_branch('first').peel(
911
- pygit2.enums.ObjectType.COMMIT).oid
911
+ pygit2.enums.ObjectType.COMMIT).id
912
912
  base = repo.lookup_branch('base').peel(
913
- pygit2.enums.ObjectType.COMMIT).oid
913
+ pygit2.enums.ObjectType.COMMIT).id
914
914
 
915
915
  gitutil.checkout('first', self.gitdir, work_tree=self.tmpdir,
916
916
  force=True)
@@ -958,7 +958,7 @@ Tested-by: Mary Smith <msmith@wibble.com> # yak
958
958
  # Check the original series was left alone
959
959
  self.assertEqual(
960
960
  first, repo.lookup_branch('first').peel(
961
- pygit2.enums.ObjectType.COMMIT).oid)
961
+ pygit2.enums.ObjectType.COMMIT).id)
962
962
  count = 2
963
963
  series1 = patchstream.get_metadata_for_list('first', self.gitdir,
964
964
  count)
@@ -968,7 +968,7 @@ Tested-by: Mary Smith <msmith@wibble.com> # yak
968
968
  # Check that base is left alone
969
969
  self.assertEqual(
970
970
  base, repo.lookup_branch('base').peel(
971
- pygit2.enums.ObjectType.COMMIT).oid)
971
+ pygit2.enums.ObjectType.COMMIT).id)
972
972
  series1 = patchstream.get_metadata_for_list('base', self.gitdir, count)
973
973
  self.assertFalse('links' in series1)
974
974
  self.assertFalse('version' in series1)
@@ -1534,8 +1534,8 @@ Tested-by: Mary Smith <msmith@wibble.com> # yak
1534
1534
  # Make sure the branches have been restored
1535
1535
  branch1 = repo.branches['first']
1536
1536
  branch2 = repo.branches['first2']
1537
- self.assertEqual(expected_commit1.oid, branch1.target)
1538
- self.assertEqual(expected_commit2.oid, branch2.target)
1537
+ self.assertEqual(expected_commit1.id, branch1.target)
1538
+ self.assertEqual(expected_commit2.id, branch2.target)
1539
1539
 
1540
1540
  # Make sure the tags were deleted
1541
1541
  try:
@@ -1721,7 +1721,7 @@ Tested-by: Mary Smith <msmith@wibble.com> # yak
1721
1721
  repo = pygit2.init_repository(self.gitdir)
1722
1722
  branch = repo.lookup_branch('first2')
1723
1723
  self.assertTrue(branch)
1724
- branch_oid = branch.peel(pygit2.enums.ObjectType.COMMIT).oid
1724
+ branch_oid = branch.peel(pygit2.enums.ObjectType.COMMIT).id
1725
1725
 
1726
1726
  pclist = cser.get_pcommit_dict()
1727
1727
  self.assertEqual(4, len(pclist))
@@ -3560,7 +3560,7 @@ Date: .*
3560
3560
  # Move off the branch and check for a sensible error
3561
3561
  commit = repo.revparse_single('first~')
3562
3562
  repo.checkout_tree(commit)
3563
- repo.set_head(commit.oid)
3563
+ repo.set_head(commit.id)
3564
3564
 
3565
3565
  with self.assertRaises(ValueError) as exc:
3566
3566
  cser._parse_series_and_version(None, None)
@@ -3701,7 +3701,7 @@ Date: .*
3701
3701
  'wip: Try out a new thing', 'Just checking', 'wibble.c',
3702
3702
  '''changes to wibble''')
3703
3703
  target = self.repo.revparse_single('HEAD')
3704
- self.repo.reset(target.oid, pygit2.enums.ResetMode.HARD)
3704
+ self.repo.reset(target.id, pygit2.enums.ResetMode.HARD)
3705
3705
 
3706
3706
  # name = gitutil.get_branch(self.gitdir)
3707
3707
  # upstream_name = gitutil.get_upstream(self.gitdir, name)
@@ -3920,6 +3920,23 @@ Date: .*
3920
3920
  show_cover_comments=True)
3921
3921
  self._check_status(out, True, True)
3922
3922
 
3923
+ def test_series_status_gather_archived(self):
3924
+ """status and gather should still work on an archived series"""
3925
+ cser, pwork = self.setup_second()
3926
+ with terminal.capture():
3927
+ cser.archive('second')
3928
+
3929
+ # status reads the patches from the archive tag, since archiving
3930
+ # deletes the branch
3931
+ with terminal.capture() as (out, _):
3932
+ cser.status(pwork, 'second', 2, False)
3933
+ self._check_status(out, False, False)
3934
+
3935
+ # gather works from patchwork and the database, with no branch
3936
+ with terminal.capture() as (out, _):
3937
+ cser.gather(pwork, 'second', 2, False, False, True, dry_run=True)
3938
+ self.assertIn('updated', out.getvalue())
3939
+
3923
3940
  def test_series_status_cmdline(self):
3924
3941
  """Test getting the status of a series, including comments"""
3925
3942
  cser, pwork = self.setup_second()
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "patch-manager"
7
- version = "0.0.8"
7
+ version = "0.0.10"
8
8
  authors = [
9
9
  { name="Simon Glass", email="sjg@chromium.org" },
10
10
  ]
File without changes
File without changes