Merge lp:~jelmer/brz/workspace into lp:brz/3.3

Proposed by Jelmer Vernooij
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
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.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
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

Revision history for this message
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

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Download full text (13.2 KiB)

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_gettext-0.1.1-py3-none-any.whl (10 kB)
Requirement already satisfied: setuptools>=46.1 in ./lib/python3.10/site-packages (from setuptools-gettext) (65.5.0)
Installing collected packages: setuptools-gettext
Successfully installed setuptools-gettext-0.1.1
Obtaining file:///tmp/tarmac/branch.v6lqq730
  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/python3/dist-packages (from breezy==3.3.1.dev0) (0.20.46)
Requirement already satisfied: merge3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.8)
Requirement already satisfied: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.0.6)
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.26.12)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.4.1)
Requirement already satisfied: patiencediff in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.2.3)
Requirement already satisfied: fastbencode in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.12)
Collecting sphinx-epytext
  Using cached sphinx-epytext-0.0.4.tar.gz (3.6 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting sphinx
  Using cached sphinx-5.3.0-py3-none-any.whl (3.2 MB)
Requirement already satisfied: setuptools in ./lib/python3.10/site-packages (from breezy==3.3.1.dev0) (65.5.0)
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.10.17)
Requirement already satisfied: gpg in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.18.0)
Collecting python-subunit
  Using cached python_subunit-1.4.0-py2.py3-none-any.whl (106 kB)
Collecting testtools
  Using cached testtools-2.5.0-py3-none-any.whl (181 kB)
Collecting fastimport
  Using cached fastimport-0.9.14.tar.gz (41 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: httplib2 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.20.4)
Collecting keyring
  Using cached keyring-23.9.3-py3-none-any.whl (35 kB)
Requirement already satisfied: lazr.restfulclient>=0.9.19 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.14.5)
Requirement already satisfied: lazr.uri in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (1.0.6)
Requirement already...

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Download full text (11.9 KiB)

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_gettext-0.1.1-py3-none-any.whl (10 kB)
Requirement already satisfied: setuptools>=46.1 in ./lib/python3.10/site-packages (from setuptools-gettext) (65.5.0)
Installing collected packages: setuptools-gettext
Successfully installed setuptools-gettext-0.1.1
Obtaining file:///tmp/tarmac/branch.dfsjabgb
  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/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.12)
Requirement already satisfied: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.0.6)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.4.1)
Requirement already satisfied: dulwich>=0.20.46 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.20.46)
Requirement already satisfied: patiencediff in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.2.3)
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.26.12)
Requirement already satisfied: merge3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.8)
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.10.17)
Collecting python-subunit
  Using cached python_subunit-1.4.0-py2.py3-none-any.whl (106 kB)
Collecting testtools
  Using cached testtools-2.5.0-py3-none-any.whl (181 kB)
Requirement already satisfied: gpg in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.18.0)
Collecting sphinx-epytext
  Using cached sphinx-epytext-0.0.4.tar.gz (3.6 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: setuptools in ./lib/python3.10/site-packages (from breezy==3.3.1.dev0) (65.5.0)
Collecting sphinx
  Using cached sphinx-5.3.0-py3-none-any.whl (3.2 MB)
Collecting fastimport
  Using cached fastimport-0.9.14.tar.gz (41 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: httplib2 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.20.4)
Collecting keyring
  Using cached keyring-23.9.3-py3-none-any.whl (35 kB)
Requirement already satisfied: lazr.restfulclient>=0.9.19 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.14.5)
Requirement already satisfied: lazr.uri in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (1.0.6)
Requirement already s...

Revision history for this message
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

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Download full text (70.4 KiB)

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_gettext-0.1.1-py3-none-any.whl (10 kB)
Requirement already satisfied: setuptools>=46.1 in ./lib/python3.10/site-packages (from setuptools-gettext) (65.5.0)
Installing collected packages: setuptools-gettext
Successfully installed setuptools-gettext-0.1.1
Obtaining file:///tmp/tarmac/branch.eukxeqnp
  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/python3/dist-packages (from breezy==3.3.2.dev0) (0.0.8)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from breezy==3.3.2.dev0) (6.0)
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/python3/dist-packages (from breezy==3.3.2.dev0) (1.26.12)
Requirement already satisfied: dulwich>=0.20.46 in /usr/lib/python3/dist-packages (from breezy==3.3.2.dev0) (0.20.50)
Requirement already satisfied: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.2.dev0) (5.0.6)
Requirement already satisfied: fastbencode in /usr/lib/python3/dist-packages (from breezy==3.3.2.dev0) (0.0.12)
Requirement already satisfied: patiencediff in /usr/lib/python3/dist-packages (from breezy==3.3.2.dev0) (0.2.3)
Collecting fastimport
  Using cached fastimport-0.9.14-py2.py3-none-any.whl
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/python3/dist-packages (from breezy==3.3.2.dev0) (1.10.17)
Requirement already satisfied: gpg in /usr/lib/python3/dist-packages (from breezy==3.3.2.dev0) (1.18.0)
Requirement already satisfied: setuptools in ./lib/python3.10/site-packages (from breezy==3.3.2.dev0) (65.5.0)
Collecting sphinx
  Using cached sphinx-5.3.0-py3-none-any.whl (3.2 MB)
Collecting docutils
  Using cached docutils-0.19-py3-none-any.whl (570 kB)
Collecting sphinx-epytext
  Using cached sphinx_epytext-0.0.4-py3-none-any.whl
Requirement already satisfied: paramiko in /usr/local/lib/python3.10/dist-packages (from breezy==3.3.2.dev0) (2.12.0)
Collecting testscenarios
  Using cached testscenarios-0.5.0-py2.py3-none-any.whl (21 kB)
Requirement already satisfied: flake8 in /usr/lib/python3/dist-packages (from breezy==3.3.2.dev0) (5.0.4)
Collecting testtools
  Using cached testtools-2.5.0-py3-none-any.whl (181 kB)
Collecting python-subunit
  Using cached python_subunit-1.4.2-py3-none-any.whl (106 kB)
Requirement already satisfied: httplib2 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.2.dev0) (0.20.4)
Requirement already satisfied: keyring in /usr/local/lib/python3.10/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.2.dev0) (23.11.0)
Requirement already satisfied: lazr.restfulclien...

Unmerged revisions

7748. By Jelmer Vernooij

Allow passing in basis tree.

7747. By Jelmer Vernooij

Make stage() public.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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)

Subscribers

People subscribed via source and target branches