/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 mergedirective.py

  • Committer: Mateusz Korniak
  • Date: 2007-09-17 10:33:57 UTC
  • Revision ID: matkor@laptop-hp-20070917103357-6300yixxury1s3n4
Bugfix: Fixed push (with overwite) behavior when branches are diverged.
Now it really works after user accepting overwrite and even shows infor about revisions pushed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import gtk
25
25
import os
26
26
 
27
 
from bzrlib.plugins.gtk.branchbox import BranchSelectionBox
28
 
 
29
27
class CreateMergeDirectiveDialog(gtk.Dialog):
30
28
    def __init__(self, branch, stop_revid=None):
31
29
        super(CreateMergeDirectiveDialog, self).__init__()
45
43
 
46
44
 
47
45
class SendMergeDirectiveDialog(gtk.Dialog):
48
 
    def __init__(self, branch, parent=None):
49
 
        super(SendMergeDirectiveDialog, self).__init__(parent)
50
 
        self.branch = branch
51
 
        self.set_title("Send Merge Directive")
52
 
        self._create()
53
 
 
54
 
    def _create(self):
55
 
        table = gtk.Table(rows=3, columns=2)
56
 
        self.vbox.add(table)
57
 
 
58
 
        label = gtk.Label()
59
 
        label.set_markup("<b>Branch to Submit:</b>")
60
 
        table.attach(label, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
61
 
 
62
 
        label = gtk.Label(str(self.branch))
63
 
        table.attach(label, 1, 2, 0, 1, gtk.FILL, gtk.FILL)
64
 
 
65
 
        label = gtk.Label()
66
 
        label.set_markup("<b>Target Branch:</b>")
67
 
        table.attach(label, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
68
 
 
69
 
        self.submit_branch = BranchSelectionBox(self.branch.get_submit_branch())
70
 
        table.attach(self.submit_branch, 1, 2, 1, 2, gtk.FILL, gtk.FILL)
71
 
 
72
 
        # TODO: Display number of revisions to be send whenever 
73
 
        # submit branch changes
74
 
 
75
 
        label = gtk.Label()
76
 
        label.set_markup("<b>Email To:</b>")
77
 
        table.attach(label, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
78
 
 
79
 
        self.mail_to = gtk.ComboBoxEntry()
80
 
        mail_to = self.branch.get_config().get_user_option('submit_to')
81
 
        if mail_to is None:
82
 
            submit_branch = self.submit_branch.get_branch()
83
 
            if submit_branch is not None:
84
 
                mail_to = submit_branch.get_config().get_user_option(
85
 
                            'child_submit_to')
86
 
        if mail_to is not None:
87
 
            self.mail_to.get_child().set_text(mail_to)
88
 
        table.attach(self.mail_to, 1, 2, 2, 3, gtk.FILL, gtk.FILL)
89
 
 
90
 
        self.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, 
91
 
                         gtk.STOCK_OK, gtk.RESPONSE_OK)
92
 
 
93
 
        self.show_all()
94
 
 
95
 
    def get_mail_to(self):
96
 
        return self.mail_to.get_child().get_text()
97
 
 
98
 
    def get_merge_directive(self):
99
 
        from bzrlib.merge_directive import MergeDirective2
100
 
        from bzrlib import osutils
101
 
        import time
102
 
        return MergeDirective2.from_objects(self.branch.repository,
103
 
                                            self.branch.last_revision(),
104
 
                                            time.time(),
105
 
                                            osutils.local_time_offset(),
106
 
                                            self.submit_branch.get_url(),
107
 
                                            public_branch=None,
108
 
                                            include_patch=True,
109
 
                                            include_bundle=True,
110
 
                                            message=None,
111
 
                                            base_revision_id=None)
112
 
 
 
46
    def __init__(self):
 
47
        super(SendMergeDirectiveDialog, self).__init__()
113
48
 
114
49
 
115
50
class ApplyMergeDirectiveDialog(gtk.Dialog):