/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-08-11 13:33:45 UTC
  • mfrom: (7379 work)
  • mto: This revision was merged to the branch mainline in revision 7389.
  • Revision ID: jelmer@jelmer.uk-20190811133345-dp9j3c569vxj4l9y
merge trunk.

Show diffs side-by-side

added added

removed removed

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