/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 bzrlib/commands.py

  • Committer: John Arbash Meinel
  • Date: 2007-07-11 23:45:20 UTC
  • mfrom: (2601 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2643.
  • Revision ID: john@arbash-meinel.com-20070711234520-do3h7zw8skbathpz
[merge] bzr.dev 2601

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    option,
45
45
    osutils,
46
46
    trace,
 
47
    win32utils,
47
48
    )
48
49
""")
49
50
 
240
241
        if self.__doc__ == Command.__doc__:
241
242
            warn("No help message set for %r" % self)
242
243
 
 
244
    def _maybe_expand_globs(self, file_list):
 
245
        """Glob expand file_list if the platform does not do that itself.
 
246
        
 
247
        :return: A possibly empty list of unicode paths.
 
248
 
 
249
        Introduced in bzrlib 0.18.
 
250
        """
 
251
        if not file_list:
 
252
            file_list = []
 
253
        if sys.platform == 'win32':
 
254
            file_list = win32utils.glob_expand(file_list)
 
255
        return list(file_list)
 
256
 
243
257
    def _usage(self):
244
258
        """Return single-line grammar for this command.
245
259
 
534
548
 
535
549
def apply_lsprofiled(filename, the_callable, *args, **kwargs):
536
550
    from bzrlib.lsprof import profile
537
 
    import cPickle
538
551
    ret, stats = profile(the_callable, *args, **kwargs)
539
552
    stats.sort()
540
553
    if filename is None:
541
554
        stats.pprint()
542
555
    else:
543
 
        stats.freeze()
544
 
        cPickle.dump(stats, open(filename, 'w'), 2)
545
 
        print 'Profile data written to %r.' % filename
 
556
        stats.save(filename)
 
557
        trace.note('Profile data written to "%s".', filename)
546
558
    return ret
547
559
 
548
560
 
714
726
 
715
727
def run_bzr_catch_errors(argv):
716
728
    try:
717
 
        try:
718
 
            return run_bzr(argv)
719
 
        finally:
720
 
            # do this here inside the exception wrappers to catch EPIPE
721
 
            sys.stdout.flush()
 
729
        return run_bzr(argv)
722
730
    except (KeyboardInterrupt, Exception), e:
723
731
        # used to handle AssertionError and KeyboardInterrupt
724
732
        # specially here, but hopefully they're handled ok by the logger now