/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to push.py

  • Committer: Curtis Hovey
  • Date: 2012-03-03 23:23:27 UTC
  • mto: This revision was merged to the branch mainline in revision 782.
  • Revision ID: sinzui.is@verizon.net-20120303232327-2484ac0xnbx4xfoz
Added a simple test for _on_push_clicked.

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
        location = self._combo.get_child().get_text()
116
116
 
117
117
        try:
118
 
            message = do_push(self.branch, location=location, overwrite=False)
 
118
            message = do_push(self.branch, location, overwrite=False)
119
119
        except errors.DivergedBranches:
120
120
            response = question_dialog(
121
121
                _i18n('Branches have been diverged'),
122
122
                _i18n('You cannot push if branches have diverged.\n'
123
123
                      'Overwrite?'))
124
124
            if response == Gtk.ResponseType.YES:
125
 
                message = do_push(
126
 
                    self.branch, location=location, overwrite=True)
 
125
                message = do_push(self.branch, location, overwrite=True)
127
126
            else:
128
127
                return
129
128
        self._history.add_entry(location)
134
133
            self._progress_widget.finished()
135
134
            self._push_message.props.label = message
136
135
            self._push_message.show()
137
 
        message
138
 
 
139
 
 
140
 
def do_push(br_from, location, overwrite):
 
136
 
 
137
 
 
138
def do_push(br_from, location, overwrite=False):
141
139
    """Update a mirror of a branch.
142
140
 
143
141
    :param br_from: the source branch
182
180
        else:
183
181
            count = tree_to.pull(br_from, overwrite)
184
182
 
185
 
    return str(count)
 
183
    return "Pushed %s revisions." % count