Merge lp:~kvilhaugsvik/qbzr/qshelve_all into lp:qbzr

Proposed by Sveinung Kvilhaugsvik
Status: Merged
Approved by: Alexander Belchenko
Approved revision: 1517
Merged at revision: 1514
Proposed branch: lp:~kvilhaugsvik/qbzr/qshelve_all
Merge into: lp:qbzr
Diff against target: 113 lines (+24/-5)
4 files modified
NEWS.txt (+6/-0)
lib/commands.py (+6/-2)
lib/shelvewindow.py (+4/-2)
lib/widgets/shelve.py (+8/-1)
To merge this branch: bzr merge lp:~kvilhaugsvik/qbzr/qshelve_all
Reviewer Review Type Date Requested Status
Alexander Belchenko Approve
Review via email: mp+186682@code.launchpad.net

Description of the change

Add the option --all to qshelve so it acts a bit more like shelve.

To post a comment you must log in.
Revision history for this message
Sveinung Kvilhaugsvik (kvilhaugsvik) wrote :

It appears that -m also was missing.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Thank you for your patch.
Mostly looks good, although I'd prefer that you added all new parameters to the end of arguments list in functions (__init__ and other). This is kind of backward compatibility, I try to follow this pattern. If you don't mind to change it I'd be grateful.
Also we need some text about changes in NEWS.txt. Can you provide some?

review: Needs Fixing
Revision history for this message
Sveinung Kvilhaugsvik (kvilhaugsvik) wrote :

Erm... I messed up my history. Sorry for the noise.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Use command
bzr heads --dead
to find your lost revisions. You need revision-id. It has form like <user@host-datestamp-random>. You need this revision id.
Then do
bzr pull . -r <your-lost-revision-id>
And you will restore your history.

Revision history for this message
Alexander Belchenko (bialix) wrote :

I suppose your last revision was
HEAD: revision-id: <email address hidden> (dead)
  committer: Sveinung Kvilhaugsvik <email address hidden>
  branch nick: 1233909
  timestamp: Tue 2013-10-15 15:10:17 +0200
  message:
    Add NEWS entry about "qshelve -m"

Your dead revision id therefore
<email address hidden>
So you can do
bzr pull . -r revid:<email address hidden>
After you restore your branch do `bzr push --overwrite` to launchpad.

Revision history for this message
Sveinung Kvilhaugsvik (kvilhaugsvik) wrote :

Fixed. I didn't loose it. I merged in a way that made it lie. (The previous version had the data from your commit today but didn't list it as a parent)

Revision history for this message
Alexander Belchenko (bialix) wrote :

Many thanks for your changes! I'll merge it.

review: Approve
Revision history for this message
Sveinung Kvilhaugsvik (kvilhaugsvik) wrote :

Great! Thanks for your help!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS.txt'
2--- NEWS.txt 2013-10-15 10:11:40 +0000
3+++ NEWS.txt 2013-10-15 13:39:11 +0000
4@@ -2,6 +2,12 @@
5 ----------------------------------
6 Maintenance release.
7
8+ * qshelve:
9+ * New command line option --all to start with all changes selected.
10+ (Sveinung Kvilhaugsvik, Bug #1227914)
11+ * New command line option --m to set the message string.
12+ (Sveinung Kvilhaugsvik, Bug #1233909)
13+
14
15 0.23.1 - 2013/07/29
16 -------------------
17
18=== modified file 'lib/commands.py'
19--- lib/commands.py 2012-09-18 08:22:25 +0000
20+++ lib/commands.py 2013-10-15 13:39:11 +0000
21@@ -1114,6 +1114,8 @@
22 ui_mode_option,
23 bzr_option('shelve', 'list'),
24 bzr_option('shelve', 'directory'),
25+ bzr_option('shelve', 'message'),
26+ Option('all', help='Select all changes.'),
27 Option('complete', help='Show complete files.'),
28 Option('ignore-whitespace', short_name='w',
29 help="Ignore whitespace when finding differences.(Only work when --list specified)"),
30@@ -1122,14 +1124,16 @@
31 ]
32
33 def _qbzr_run(self, file_list=None, list=False, directory=None, ui_mode=False,
34- complete=False, ignore_whitespace=False, encoding=None):
35+ complete=False, ignore_whitespace=False, encoding=None,
36+ all=False, message=None):
37 if list:
38 initial_tab = 1
39 else:
40 initial_tab = 0
41 self.main_window = ShelveWindow(file_list=file_list, directory=directory, ui_mode=ui_mode,
42 initial_tab=initial_tab, complete=complete,
43- ignore_whitespace=ignore_whitespace, encoding=encoding)
44+ ignore_whitespace=ignore_whitespace, encoding=encoding,
45+ select_all=all, message=message)
46 self.main_window.show()
47 self._application.exec_()
48
49
50=== modified file 'lib/shelvewindow.py'
51--- lib/shelvewindow.py 2012-05-14 11:27:11 +0000
52+++ lib/shelvewindow.py 2013-10-15 13:39:11 +0000
53@@ -59,7 +59,8 @@
54 class ShelveWindow(QBzrWindow):
55
56 def __init__(self, initial_tab=0, directory=None, file_list=None, complete=False,
57- ignore_whitespace=False, encoding=None, parent=None, ui_mode=True):
58+ ignore_whitespace=False, encoding=None, parent=None, ui_mode=True,
59+ select_all=False, message=None):
60 QBzrWindow.__init__(self,
61 [gettext("Shelve Manager")],
62 parent, ui_mode=ui_mode)
63@@ -78,7 +79,8 @@
64
65 shelve_view = ShelveWidget(file_list=file_list, directory=self.directory,
66 complete=complete, encoding=encoding,
67- splitters=self.splitters, parent=self)
68+ splitters=self.splitters, parent=self,
69+ select_all=select_all, init_msg=message)
70 shelvelist_view = ShelveListWidget(directory=self.directory,
71 complete=complete, ignore_whitespace=ignore_whitespace,
72 encoding=encoding, splitters=self.splitters, parent=self)
73
74=== modified file 'lib/widgets/shelve.py'
75--- lib/widgets/shelve.py 2012-05-14 11:31:32 +0000
76+++ lib/widgets/shelve.py 2013-10-15 13:39:11 +0000
77@@ -237,7 +237,7 @@
78 class ShelveWidget(ToolbarPanel):
79
80 def __init__(self, file_list=None, directory=None, complete=False, encoding=None,
81- splitters=None, parent=None):
82+ splitters=None, parent=None, select_all=False, init_msg=None):
83 ToolbarPanel.__init__(self, slender=False, icon_size=22, parent=parent)
84
85 self.revision = None
86@@ -246,6 +246,7 @@
87 self.message = None
88
89 self.initial_encoding = encoding
90+ self.select_all = select_all
91
92 self.current_layout = -1
93 self.load_settings()
94@@ -276,6 +277,8 @@
95 self.completer.setModel(self.completer_model)
96 self.message.setCompleter(self.completer)
97 self.message.setAcceptRichText(False)
98+ if init_msg is not None:
99+ self.message.setText(init_msg)
100 SpellCheckHighlighter(self.message.document(), spell_checker)
101
102 message_layout.addWidget(self.message)
103@@ -485,6 +488,10 @@
104 for func in cleanup:
105 func()
106
107+ if self.select_all:
108+ self.check_all(True)
109+ self.select_all = False
110+
111 self.loaded = True
112
113 def _create_item(self, change, shelver, trees, old_changes):

Subscribers

People subscribed via source and target branches