Status: | Needs review |
---|---|
Proposed branch: | lp:~jelmer/brz/workspace |
Merge into: | lp:brz/3.3 |
Diff against target: |
94 lines (+21/-13) 1 file modified
breezy/workspace.py (+21/-13) |
To merge this branch: | bzr merge lp:~jelmer/brz/workspace |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jelmer Vernooij | Approve | ||
Review via email: mp+432231@code.launchpad.net |
This proposal supersedes a proposal from 2022-01-17.
Commit message
workspace: Allow passing in basis_tree.
Description of the change
workspace: Allow passing in basis_tree.
Jelmer Vernooij (jelmer) : Posted in a previous version of this proposal | # |
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal | # |
The Breezy Bot (the-breezy-bot) wrote : | # |
Attempt to merge into lp:brz/3.3 failed due to conflicts:
text conflict in breezy/workspace.py
The Breezy Bot (the-breezy-bot) wrote : | # |
Attempt to merge into lp:brz/3.3 failed due to conflicts:
text conflict in breezy/workspace.py
The Breezy Bot (the-breezy-bot) wrote : | # |
The attempt to merge lp:~jelmer/brz/workspace into lp:brz/3.3 failed. Command exited with 142.
Below is the output from the failed tests.
Collecting setuptools-gettext
Using cached setuptools_
Requirement already satisfied: setuptools>=46.1 in ./lib/python3.
Installing collected packages: setuptools-gettext
Successfully installed setuptools-
Obtaining file://
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Checking if build backend supports build_editable: started
Checking if build backend supports build_editable: finished with status 'done'
Getting requirements to build editable: started
Getting requirements to build editable: finished with status 'done'
Preparing editable metadata (pyproject.toml): started
Preparing editable metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: dulwich>=0.20.46 in /usr/lib/
Requirement already satisfied: merge3 in /usr/lib/
Requirement already satisfied: configobj in /usr/lib/
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/
Requirement already satisfied: pyyaml in /usr/lib/
Requirement already satisfied: patiencediff in /usr/lib/
Requirement already satisfied: fastbencode in /usr/lib/
Collecting sphinx-epytext
Using cached sphinx-
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting sphinx
Using cached sphinx-
Requirement already satisfied: setuptools in ./lib/python3.
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/
Requirement already satisfied: gpg in /usr/lib/
Collecting python-subunit
Using cached python_
Collecting testtools
Using cached testtools-
Collecting fastimport
Using cached fastimport-
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: httplib2 in /usr/lib/
Collecting keyring
Using cached keyring-
Requirement already satisfied: lazr.restfulcli
Requirement already satisfied: lazr.uri in /usr/lib/
Requirement already...
The Breezy Bot (the-breezy-bot) wrote : | # |
The attempt to merge lp:~jelmer/brz/workspace into lp:brz/3.3 failed. Command exited with 1.
Below is the output from the failed tests.
Collecting setuptools-gettext
Using cached setuptools_
Requirement already satisfied: setuptools>=46.1 in ./lib/python3.
Installing collected packages: setuptools-gettext
Successfully installed setuptools-
Obtaining file://
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Checking if build backend supports build_editable: started
Checking if build backend supports build_editable: finished with status 'done'
Getting requirements to build editable: started
Getting requirements to build editable: finished with status 'done'
Preparing editable metadata (pyproject.toml): started
Preparing editable metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: fastbencode in /usr/lib/
Requirement already satisfied: configobj in /usr/lib/
Requirement already satisfied: pyyaml in /usr/lib/
Requirement already satisfied: dulwich>=0.20.46 in /usr/lib/
Requirement already satisfied: patiencediff in /usr/lib/
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/
Requirement already satisfied: merge3 in /usr/lib/
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/
Collecting python-subunit
Using cached python_
Collecting testtools
Using cached testtools-
Requirement already satisfied: gpg in /usr/lib/
Collecting sphinx-epytext
Using cached sphinx-
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: setuptools in ./lib/python3.
Collecting sphinx
Using cached sphinx-
Collecting fastimport
Using cached fastimport-
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: httplib2 in /usr/lib/
Collecting keyring
Using cached keyring-
Requirement already satisfied: lazr.restfulcli
Requirement already satisfied: lazr.uri in /usr/lib/
Requirement already s...
The Breezy Bot (the-breezy-bot) wrote : | # |
Attempt to merge into lp:brz/3.3 failed due to conflicts:
text conflict in breezy/workspace.py
The Breezy Bot (the-breezy-bot) wrote : | # |
The attempt to merge lp:~jelmer/brz/workspace into lp:brz/3.3 failed. Command exited with 2.
Below is the output from the failed tests.
Collecting setuptools-gettext
Using cached setuptools_
Requirement already satisfied: setuptools>=46.1 in ./lib/python3.
Installing collected packages: setuptools-gettext
Successfully installed setuptools-
Obtaining file://
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Checking if build backend supports build_editable: started
Checking if build backend supports build_editable: finished with status 'done'
Getting requirements to build editable: started
Getting requirements to build editable: finished with status 'done'
Preparing editable metadata (pyproject.toml): started
Preparing editable metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: merge3 in /usr/lib/
Requirement already satisfied: pyyaml in /usr/lib/
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/
Requirement already satisfied: dulwich>=0.20.46 in /usr/lib/
Requirement already satisfied: configobj in /usr/lib/
Requirement already satisfied: fastbencode in /usr/lib/
Requirement already satisfied: patiencediff in /usr/lib/
Collecting fastimport
Using cached fastimport-
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/
Requirement already satisfied: gpg in /usr/lib/
Requirement already satisfied: setuptools in ./lib/python3.
Collecting sphinx
Using cached sphinx-
Collecting docutils
Using cached docutils-
Collecting sphinx-epytext
Using cached sphinx_
Requirement already satisfied: paramiko in /usr/local/
Collecting testscenarios
Using cached testscenarios-
Requirement already satisfied: flake8 in /usr/lib/
Collecting testtools
Using cached testtools-
Collecting python-subunit
Using cached python_
Requirement already satisfied: httplib2 in /usr/lib/
Requirement already satisfied: keyring in /usr/local/
Requirement already satisfied: lazr.restfulcli
Unmerged revisions
- 7748. By Jelmer Vernooij
-
Allow passing in basis tree.
- 7747. By Jelmer Vernooij
-
Make stage() public.
Preview Diff
1 | === modified file 'breezy/workspace.py' |
2 | --- breezy/workspace.py 2022-11-02 20:28:56 +0000 |
3 | +++ breezy/workspace.py 2022-11-27 12:34:23 +0000 |
4 | @@ -20,7 +20,7 @@ |
5 | high performance in large trees with a small number of changes. |
6 | """ |
7 | |
8 | -from contextlib import ExitStack |
9 | +from contextlib import ExitStack, contextmanager |
10 | import errno |
11 | import os |
12 | import shutil |
13 | @@ -173,9 +173,10 @@ |
14 | :param use_inotify: whether to use inotify (default: yes, if available) |
15 | """ |
16 | |
17 | - def __init__(self, tree, subpath='', use_inotify=None): |
18 | + def __init__(self, tree, *, basis_tree=None, subpath='', use_inotify=None): |
19 | self.tree = tree |
20 | self.subpath = subpath |
21 | + self._basis_tree = basis_tree |
22 | self.use_inotify = use_inotify |
23 | self._dirty_tracker = None |
24 | self._es = ExitStack() |
25 | @@ -183,7 +184,7 @@ |
26 | @classmethod |
27 | def from_path(cls, path, use_inotify=None): |
28 | tree, subpath = WorkingTree.open_containing(path) |
29 | - return cls(tree, subpath, use_inotify=use_inotify) |
30 | + return cls(tree, subpath=subpath, use_inotify=use_inotify) |
31 | |
32 | def __enter__(self): |
33 | check_clean_tree(self.tree) |
34 | @@ -199,6 +200,13 @@ |
35 | self._dirty_tracker = None |
36 | return self |
37 | |
38 | + @contextmanager |
39 | + def basis_tree(self): |
40 | + if self._basis_tree: |
41 | + yield self._basis_tree |
42 | + return |
43 | + yield self.tree.basis_tree() |
44 | + |
45 | def __exit__(self, exc_type, exc_val, exc_tb): |
46 | return self._es.__exit__(exc_type, exc_val, exc_tb) |
47 | |
48 | @@ -216,12 +224,13 @@ |
49 | """ |
50 | if self._dirty_tracker and not self._dirty_tracker.is_dirty(): |
51 | return |
52 | - reset_tree(self.tree, subpath=self.subpath) |
53 | + with self.tree.lock_write(): |
54 | + reset_tree(self.tree, subpath=self.subpath) |
55 | if self._dirty_tracker is not None: |
56 | self._dirty_tracker.mark_clean() |
57 | |
58 | - def _stage(self) -> Optional[List[str]]: |
59 | - changed: Optional[List[str]] |
60 | + def stage(self) -> List[str]: |
61 | + changed: List[str] |
62 | if self._dirty_tracker: |
63 | relpaths = self._dirty_tracker.relpaths() |
64 | # Sort paths so that directories get added before the files they |
65 | @@ -239,15 +248,14 @@ |
66 | |
67 | if self.tree.supports_setting_file_ids(): |
68 | from .rename_map import RenameMap |
69 | - basis_tree = self.tree.basis_tree() |
70 | - RenameMap.guess_renames( |
71 | - basis_tree, self.tree, dry_run=False) |
72 | + with self.basis_tree() as basis_tree: |
73 | + RenameMap.guess_renames( |
74 | + basis_tree, self.tree, dry_run=False) |
75 | return changed |
76 | |
77 | def iter_changes(self): |
78 | - with self.tree.lock_write(): |
79 | - specific_files = self._stage() |
80 | - basis_tree = self.tree.basis_tree() |
81 | + with self.tree.lock_write(), self.basis_tree() as basis_tree: |
82 | + specific_files = self.stage() |
83 | for change in self.tree.iter_changes( |
84 | basis_tree, specific_files=specific_files, |
85 | want_unversioned=False, require_versioned=True): |
86 | @@ -267,7 +275,7 @@ |
87 | raise NotImplementedError(self.commit) |
88 | |
89 | with self.tree.lock_write(): |
90 | - specific_files = self._stage() |
91 | + specific_files = self.stage() |
92 | |
93 | kwargs['specific_files'] = specific_files |
94 | revid = self.tree.commit(**kwargs) |
Running landing tests failed /ci.breezy- vcs.org/ job/brz- 3.2/job/ brz-3.2- land/105/
https:/