Merge lp://qastaging/~doxxx/bzrtools/shell-dir into lp://qastaging/bzrtools

Proposed by Gordon Tyler
Status: Merged
Merged at revision: not available
Proposed branch: lp://qastaging/~doxxx/bzrtools/shell-dir
Merge into: lp://qastaging/bzrtools
Diff against target: 48 lines (+14/-4)
2 files modified
command_classes.py (+11/-3)
shell.py (+3/-1)
To merge this branch: bzr merge lp://qastaging/~doxxx/bzrtools/shell-dir
Reviewer Review Type Date Requested Status
Aaron Bentley Approve
Review via email: mp+14919@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Gordon Tyler (doxxx) wrote :

Adds support for a --directory (-d) option to the shell command which changes the working directory to the given path before starting the shell.

Usecase: On Windows, I can add a context menu entry for folders to run 'bzr shell -d %1' to start the shell in the selected folder.

Revision history for this message
Aaron Bentley (abentley) wrote :

Thanks, taken.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'command_classes.py'
--- command_classes.py 2009-10-20 22:21:59 +0000
+++ command_classes.py 2009-11-16 20:55:18 +0000
@@ -48,7 +48,7 @@
4848
49class cmd_graph_ancestry(BzrToolsCommand):49class cmd_graph_ancestry(BzrToolsCommand):
50 """Produce ancestry graphs using dot.50 """Produce ancestry graphs using dot.
51 51
52 Output format is detected according to file extension. Some of the more52 Output format is detected according to file extension. Some of the more
53 common output formats are html, png, gif, svg, ps. An extension of '.dot'53 common output formats are html, png, gif, svg, ps. An extension of '.dot'
54 will cause a dot graph file to be produced. HTML output has mouseovers54 will cause a dot graph file to be produced. HTML output has mouseovers
@@ -342,9 +342,17 @@
342 --all --help --revision --show-ids342 --all --help --revision --show-ids
343 bzr bzrtools:287/> status --343 bzr bzrtools:287/> status --
344 """344 """
345 def run(self):345 takes_options = [
346 Option('directory',
347 help='Branch in which to start the shell, '
348 'rather than the one containing the working directory.',
349 short_name='d',
350 type=unicode,
351 ),
352 ]
353 def run(self, directory=None):
346 import shell354 import shell
347 return shell.run_shell()355 return shell.run_shell(directory)
348356
349357
350class cmd_branch_history(BzrToolsCommand):358class cmd_branch_history(BzrToolsCommand):
351359
=== modified file 'shell.py'
--- shell.py 2009-11-12 09:17:55 +0000
+++ shell.py 2009-11-16 20:55:18 +0000
@@ -227,8 +227,10 @@
227 return CompletionContext(text, command=cmd).get_completions()227 return CompletionContext(text, command=cmd).get_completions()
228228
229229
230def run_shell():230def run_shell(directory=None):
231 try:231 try:
232 if not directory is None:
233 os.chdir(directory)
232 prompt = PromptCmd()234 prompt = PromptCmd()
233 while True:235 while True:
234 try:236 try:

Subscribers

People subscribed via source and target branches