[MERGE] pre_commit hook (was: [RFC] pre_commit hook)

Nam Nguyen bitsink+bazaar at gmail.com
Wed Aug 15 10:29:18 BST 2007


On 8/15/07, John Arbash Meinel <john at arbash-meinel.com> wrote:
> John Arbash Meinel has voted resubmit.
> Status is now: Resubmit
> Comment:
> +    def capture_pre_commit_hook(self, local, master, old_revno,
> old_revid,
> +                                new_revno, new_revid, affected, tree):
> +        # replacing ids with paths
> +        # notice that we leave deleted ids in tact
> +        for change, ids in affected.iteritems():
> +            if change == 'deleted':
> +                continue
> +            for i, id in enumerate(ids):
> +                ids[i] = tree.id2path(id)
> +        self.hook_calls.append(('pre_commit', old_revno, old_revid,
> +                                new_revno, new_revid, affected))
> +
>
>
> I believe the word is 'intact' not 'in tact'.
>
> Also, munging the ids into paths was probably less disruptive for your
> tests, but means that we aren't really testing what we think we are.

Now I'm leaving the ids intact.

> And I would like to see tests for adding a file, deleting a file,
> renaming a file, and just modifying a file. To make sure all of those
> cases show up in the 'affected_ids' list.

And new cases added.

Cheers
Nam
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: precommit3.txt
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20070815/aa8c5bd3/attachment-0001.txt 


More information about the bazaar mailing list