~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to branchhistory.py

  • Committer: Aaron Bentley
  • Date: 2006-11-23 18:06:43 UTC
  • Revision ID: abentley@panoramicfeedback.com-20061123180643-6ry3xqozdbn4cfhy
Update docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from bzrlib import errors
2
1
from bzrlib.branch import Branch
3
2
from bzrlib.config import extract_email_address
4
3
from bzrtools import short_committer
10
9
    b.repository.lock_read()
11
10
    try:
12
11
        for revno, revision in iter_revisiondata(b):
13
 
            new_descriptor = (revision.committer,
 
12
            new_descriptor = (revision.committer, 
14
13
                              revision.properties.get('branch-nick'))
15
14
            if descriptor is None:
16
15
                descriptor = new_descriptor
25
24
        b.repository.unlock()
26
25
 
27
26
def branch_change(old_descriptor, new_descriptor):
28
 
    try:
29
 
        old_email = extract_email_address(old_descriptor[0])
30
 
    except errors.NoEmailInUsername:
31
 
        old_email = None
32
 
    try:
33
 
        new_email = extract_email_address(new_descriptor[0])
34
 
    except errors.NoEmailInUsername:
35
 
        new_email = None
36
27
    if old_descriptor == new_descriptor:
37
28
        return False
38
29
    elif None not in (old_descriptor[1], new_descriptor[1]) and \
41
32
    elif short_committer(old_descriptor[0]) ==\
42
33
        short_committer(new_descriptor[0]):
43
34
        return False
44
 
    elif old_descriptor[0].strip(' ') == new_email:
 
35
    elif old_descriptor[0].strip(' ') == \
 
36
        extract_email_address(new_descriptor[0]):
45
37
        return False
46
 
    elif new_descriptor[0].strip(' ') == old_email:
 
38
    elif new_descriptor[0].strip(' ') == \
 
39
        extract_email_address(old_descriptor[0]):
47
40
        return False
48
41
    else:
49
42
        return True