~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: Parth Malwankar
  • Date: 2010-08-31 13:49:48 UTC
  • mto: This revision was merged to the branch mainline in revision 5411.
  • Revision ID: parth.malwankar@gmail.com-20100831134948-1ey2k6224zf5i6q0
added pre_status hook

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
        old.lock_read()
152
152
        new.lock_read()
153
153
        try:
 
154
            for hook in hooks['pre_status']:
 
155
                hook(StatusHookParams(old, new, to_file, versioned,
 
156
                    show_ids, short, verbose))
 
157
 
154
158
            specific_files, nonexistents \
155
159
                = _filter_nonexistent(specific_files, old, new)
156
160
            want_unversioned = not versioned
212
216
            if nonexistents:
213
217
                raise errors.PathsDoNotExist(nonexistents)
214
218
            for hook in hooks['post_status']:
215
 
                hook(StatusPostHookParams(old, new, to_file, versioned,
 
219
                hook(StatusHookParams(old, new, to_file, versioned,
216
220
                    show_ids, short, verbose))
217
221
        finally:
218
222
            old.unlock()
377
381
        """
378
382
        _mod_hooks.Hooks.__init__(self)
379
383
        self.create_hook(_mod_hooks.HookPoint('post_status',
380
 
            "Called with argument StatusPostHookParams after Bazaar has "
381
 
            "displayed the status. StatusPostHookParams has the attriubutes "
 
384
            "Called with argument StatusHookParams after Bazaar has "
 
385
            "displayed the status. StatusHookParams has the attributes "
 
386
            "(old_tree, new_tree, to_file, versioned, show_ids, short, "
 
387
            "verbose). The last four arguments correspond to the command "
 
388
            "line options specified by the user for the status command. "
 
389
            "to_file is the output stream for writing.",
 
390
            (2, 3), None))
 
391
        self.create_hook(_mod_hooks.HookPoint('pre_status',
 
392
            "Called with argument StatusHookParams before Bazaar "
 
393
            "displays the status. StatusHookParams has the attributes "
382
394
            "(old_tree, new_tree, to_file, versioned, show_ids, short, "
383
395
            "verbose). The last four arguments correspond to the command "
384
396
            "line options specified by the user for the status command. "
389
401
hooks = StatusHooks()
390
402
 
391
403
 
392
 
class StatusPostHookParams(object):
 
404
class StatusHookParams(object):
393
405
    """Object holding parameters passed to post_status hooks.
394
406
 
395
407
    :ivar old_tree: Start tree (basis tree) for comparison.