/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-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
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
 
        with branch.lock_write():
 
122
        branch.lock_write()
 
123
        try:
123
124
            branch.set_stacked_on_url(on_url)
124
125
            if not trace.is_quiet():
125
126
                ui.ui_factory.note(gettext(
126
127
                    "{0} is now stacked on {1}\n").format(
127
128
                    branch.base, branch.get_stacked_on_url()))
 
129
        finally:
 
130
            branch.unlock()
128
131
 
129
132
 
130
133
class ReconfigureUnstacked(object):
131
134
 
132
135
    def apply(self, controldir):
133
136
        branch = controldir.open_branch()
134
 
        with branch.lock_write():
 
137
        branch.lock_write()
 
138
        try:
135
139
            branch.set_stacked_on_url(None)
136
140
            if not trace.is_quiet():
137
141
                ui.ui_factory.note(gettext(
138
142
                    "%s is now not stacked\n")
139
143
                    % (branch.base,))
 
144
        finally:
 
145
            branch.unlock()
140
146
 
141
147
 
142
148
class Reconfigure(object):