/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 gen_changeset.py

  • Committer: John Arbash Meinel
  • Date: 2005-06-28 21:45:36 UTC
  • mto: (0.5.85) (1185.82.1 bzr-w-changeset)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: john@arbash-meinel.com-20050628214536-b4e19f1023cbcad1
Fixed up the argument handling so it handles null portions of the range correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    """
26
26
    # If only 1 entry is given, then we assume we want just the
27
27
    # changeset between that entry and it's base (we assume parents[0])
28
 
    if len(revnos) <= 1:
29
 
        if not revnos or revnos[0] is None:
30
 
            new = branch.last_patch()
31
 
        else:
32
 
            new = branch.lookup_revision(revnos[0])
 
28
    if len(revnos) == 0:
 
29
        revnos = [None, None]
 
30
    elif len(revnos) == 1:
 
31
        revnos = [None, revnos[0]]
 
32
 
 
33
    if revnos[1] is None:
 
34
        new = branch.last_patch()
 
35
    else:
 
36
        new = branch.lookup_revision(revnos[1])
 
37
    if revnos[0] is None:
33
38
        old = branch.get_revision(new).parents[0].revision_id
34
 
        return old, new
35
 
    elif len(revnos) == 2:
 
39
    else:
36
40
        old = branch.lookup_revision(revnos[0])
37
 
        new = branch.lookup_revision(revnos[1])
38
 
    else:
39
 
        raise BzrCommandError('bzr changeset takes at most 2 revisions a base & a target')
40
41
 
41
42
    return old, new
42
43