~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: John Arbash Meinel
  • Date: 2005-07-10 15:23:09 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-20050710152309-910378616528a24f
Making BASE optional, defaulting to TARGET.parents[0]

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    If --verbose, renames will be given as an 'add + delete' style patch.
68
68
    """
69
69
    takes_options = ['verbose']
70
 
    takes_args = ['base', 'target?', 'starting-rev-id?']
 
70
    takes_args = ['base?', 'target?', 'starting-rev-id?']
71
71
    aliases = ['cset']
72
72
 
73
73
    def run(self, base=None, target=None, starting_rev_id=None, verbose=False):
78
78
        import sys
79
79
        import codecs
80
80
 
81
 
        base_path, base_revno = parse_spec(base)
82
 
        b_base = find_branch(base_path)
83
 
        if base_revno is None or base_revno == -1:
84
 
            base_rev_id = base_branch.last_patch()
85
 
        else:
86
 
            base_rev_id = base_branch.last_patch()
87
 
 
88
81
        if target is None:
89
82
            target = './@'
90
83
        b_target_path, target_revno = parse_spec(target)
94
87
        else:
95
88
            target_rev_id = b_target.lookup_revision(target_revno)
96
89
 
 
90
        if base is None:
 
91
            b_base = b_target
 
92
            target_rev = b_target.get_revision(target_rev_id)
 
93
            base_rev_id = target_rev_id.parents[0].revision_id
 
94
        else:
 
95
            base_path, base_revno = parse_spec(base)
 
96
            b_base = find_branch(base_path)
 
97
            if base_revno is None or base_revno == -1:
 
98
                base_rev_id = base_branch.last_patch()
 
99
            else:
 
100
                base_rev_id = base_branch.last_patch()
 
101
 
97
102
        outf = codecs.getwriter(bzrlib.user_encoding)(sys.stdout,
98
103
                errors='replace')
99
104