/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: Jelmer Vernooij
  • Date: 2019-03-05 07:32:38 UTC
  • mto: (7290.1.21 work)
  • mto: This revision was merged to the branch mainline in revision 7311.
  • Revision ID: jelmer@jelmer.uk-20190305073238-zlqn981opwnqsmzi
Add appveyor configuration.

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