/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 breezy/git/git_remote_helper.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 18:59:44 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20181116185944-biefv1sub37qfybm
Sprinkle some PEP8iness.

Merged from https://code.launchpad.net/~jelmer/brz/more-cleanups/+merge/358611

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
else:
61
61
    CAPABILITIES.append("import")
62
62
 
 
63
 
63
64
def open_remote_dir(url):
64
65
    try:
65
66
        return ControlDir.open(url)
75
76
    for (sha1, ref) in wants:
76
77
        revs.append((sha1, None))
77
78
    if (isinstance(remote_repo, GitRepository) and
78
 
        isinstance(local_repo, GitRepository)):
 
79
            isinstance(local_repo, GitRepository)):
79
80
        lossy = False
80
81
    else:
81
82
        lossy = True
109
110
        self.wants = []
110
111
 
111
112
    def cmd_capabilities(self, outf, argv):
112
 
        outf.write(b"\n".join([c.encode() for c in CAPABILITIES])+b"\n\n")
 
113
        outf.write(b"\n".join([c.encode() for c in CAPABILITIES]) + b"\n\n")
113
114
 
114
115
    def cmd_list(self, outf, argv):
115
116
        try:
147
148
        if dest_branch_name == "master":
148
149
            dest_branch_name = None
149
150
        remote_branch = self.remote_dir.open_branch(name=dest_branch_name)
150
 
        exporter = fastexporter.BzrFastExporter(remote_branch,
151
 
            outf=outf, ref=ref,
152
 
            checkpoint=None, import_marks_file=None,
153
 
            export_marks_file=None, revision=None,
154
 
            verbose=None, plain_format=True,
155
 
            rewrite_tags=False)
 
151
        exporter = fastexporter.BzrFastExporter(
 
152
            remote_branch, outf=outf, ref=ref, checkpoint=None,
 
153
            import_marks_file=None, export_marks_file=None, revision=None,
 
154
            verbose=None, plain_format=True, rewrite_tags=False)
156
155
        exporter.run()
157
156
 
158
157
    commands = {
166
165
 
167
166
    def process(self, inf, outf):
168
167
        while True:
169
 
            l = inf.readline()
170
 
            if not l:
 
168
            line = inf.readline()
 
169
            if not line:
171
170
                break
172
 
            self.process_line(l, outf)
 
171
            self.process_line(line, outf)
173
172
 
174
173
    def process_line(self, l, outf):
175
174
        argv = l.strip().split()
176
175
        if argv == []:
177
176
            if self.batchcmd == "fetch":
178
 
                fetch(outf, self.wants, self.shortname, self.remote_dir, self.local_dir)
 
177
                fetch(outf, self.wants, self.shortname,
 
178
                      self.remote_dir, self.local_dir)
179
179
            elif self.batchcmd == "push":
180
 
                push(outf, self.wants, self.shortname, self.remote_dir, self.local_dir)
 
180
                push(outf, self.wants, self.shortname,
 
181
                     self.remote_dir, self.local_dir)
181
182
            elif self.batchcmd is None:
182
183
                return
183
184
            else:
185
186
            self.batchcmd = None
186
187
        else:
187
188
            try:
188
 
               self.commands[argv[0]](self, outf, argv)
 
189
                self.commands[argv[0]](self, outf, argv)
189
190
            except KeyError:
190
 
               raise Exception("Unknown remote command %r" % argv)
 
191
                raise Exception("Unknown remote command %r" % argv)
191
192
        outf.flush()
192
193
 
193
194