/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/reconfigure.py

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
constructing a class or using a factory method on Reconfigure.
21
21
"""
22
22
 
23
 
from __future__ import absolute_import
24
 
 
25
23
 
26
24
from . import (
27
25
    branch,
119
117
        # a path relative to itself...
120
118
        on_url = urlutils.relative_url(branch.base,
121
119
                                       urlutils.normalize_url(stacked_on_url))
122
 
        branch.lock_write()
123
 
        try:
 
120
        with branch.lock_write():
124
121
            branch.set_stacked_on_url(on_url)
125
122
            if not trace.is_quiet():
126
123
                ui.ui_factory.note(gettext(
127
124
                    "{0} is now stacked on {1}\n").format(
128
125
                    branch.base, branch.get_stacked_on_url()))
129
 
        finally:
130
 
            branch.unlock()
131
126
 
132
127
 
133
128
class ReconfigureUnstacked(object):
134
129
 
135
130
    def apply(self, controldir):
136
131
        branch = controldir.open_branch()
137
 
        branch.lock_write()
138
 
        try:
 
132
        with branch.lock_write():
139
133
            branch.set_stacked_on_url(None)
140
134
            if not trace.is_quiet():
141
135
                ui.ui_factory.note(gettext(
142
136
                    "%s is now not stacked\n")
143
137
                    % (branch.base,))
144
 
        finally:
145
 
            branch.unlock()
146
138
 
147
139
 
148
140
class Reconfigure(object):