Merge lp:~jelmer/brz/memorybranch-config into lp:brz/3.1

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/memorybranch-config
Merge into: lp:brz/3.1
Diff against target: 28 lines (+14/-0)
1 file modified
breezy/memorybranch.py (+14/-0)
To merge this branch: bzr merge lp:~jelmer/brz/memorybranch-config
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+400725@code.launchpad.net

Commit message

Add MemoryBranch.get_config_stack.

Description of the change

Add MemoryBranch.get_config_stack.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/memorybranch.py'
2--- breezy/memorybranch.py 2021-03-29 11:59:17 +0000
3+++ breezy/memorybranch.py 2021-04-07 18:13:14 +0000
4@@ -52,6 +52,9 @@
5 self.repository.lock_read()
6 return LogicalLockResult(self.unlock)
7
8+ def is_locked(self):
9+ return self.repository.is_locked()
10+
11 def lock_write(self, token=None):
12 self.repository.lock_write()
13 return BranchWriteLockResult(self.unlock, None)
14@@ -89,3 +92,14 @@
15 distance_from_last:
16 self._extend_partial_history(distance_from_last)
17 return self._partial_revision_history_cache[distance_from_last]
18+
19+ def get_config_stack(self):
20+ """Get a breezy.config.BranchStack for this Branch.
21+
22+ This can then be used to get and set configuration options for the
23+ branch.
24+
25+ :return: A breezy.config.BranchStack.
26+ """
27+ gstore = _mod_config.GlobalStore()
28+ return _mod_config.Stack([_mod_config.NameMatcher(gstore, 'DEFAULT').get_sections])

Subscribers

People subscribed via source and target branches