/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 foreign/__init__.py

Merge bzr-foreign.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
 
60
60
 
61
61
class cmd_dpush(Command):
62
 
    """Push diffs into a foreign version control system without any 
63
 
    Bazaar-specific metadata.
 
62
    """Push diffs into a foreign branch without any bzr-specific metadata.
64
63
 
65
64
    This will afterwards rebase the local Bazaar branch on the remote
66
65
    branch unless the --no-rebase option is used, in which case 
73
72
            short_name='d',
74
73
            type=unicode,
75
74
            ),
 
75
            Option("idmap-file", help="Write map with old and new revision ids.", type=str),
76
76
            Option('no-rebase', help="Don't rebase after push")]
77
77
 
78
78
    def run(self, location=None, remember=False, directory=None, 
79
 
            no_rebase=False):
 
79
            no_rebase=False, idmap_file=None):
80
80
        from bzrlib import urlutils
81
81
        from bzrlib.bzrdir import BzrDir
82
82
        from bzrlib.errors import BzrCommandError, NoWorkingTree
120
120
                no_rebase = True
121
121
            else:
122
122
                revid_map = target_branch.dpull(source_branch)
 
123
                if idmap_file:
 
124
                    f = open(idmap_file, "w")
 
125
                    try:
 
126
                        f.write("".join(["%s\t%s\n" % item for item in revid_map.iteritems()]))
 
127
                    finally:
 
128
                        f.close()
123
129
            # We successfully created the target, remember it
124
130
            if source_branch.get_push_location() is None or remember:
125
131
                source_branch.set_push_location(target_branch.base)
144
150
 
145
151
 
146
152
class cmd_foreign_mapping_upgrade(Command):
147
 
    """Upgrade revisions mapped from a foreign version control system 
148
 
    in a Bazaar branch.
 
153
    """Upgrade revisions mapped from a foreign version control system.
149
154
    
150
155
    This will change the identity of revisions whose parents 
151
156
    were mapped from revisions in the other version control system.