~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to gen_changeset.py

  • Committer: John Arbash Meinel
  • Date: 2005-07-10 16:31:40 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-20050710163140-f938871b1e269e98
Fixed handling when base does not exist in local tree, and workaround for older revisions without precursor sha hashes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
from bzrlib.inventory import ROOT_ID
11
11
from bzrlib.errors import BzrCommandError
 
12
from bzrlib.trace import warning, mutter
12
13
 
13
14
try:
14
15
    set
293
294
                and self.base_revision.revision_id != assumed_base):
294
295
            base = self.base_revision.revision_id
295
296
            write(base, key='base')
296
 
            write(self.target_branch.get_revision_sha1(base), key='base sha1')
 
297
            write(self.base_branch.get_revision_sha1(base), key='base sha1')
297
298
 
298
299
        self._write_revisions()
299
300
 
317
318
            if len(rev.parents) > 0:
318
319
                self.to_file.write('#    parents:\n')
319
320
                for parent in rev.parents:
320
 
                    self.to_file.write('#       %s\t%s\n' % (
321
 
                        parent.revision_id,
322
 
                        parent.revision_sha1))
 
321
                    p_id = parent.revision_id
 
322
                    p_sha1 = parent.revision_sha1
 
323
                    if p_sha1 is None:
 
324
                        warning('Rev id {%s} parent {%s} missing sha hash.'
 
325
                                % (rev_id, p_id))
 
326
                        p_sha1 = self.target_branch.get_revision_sha1(p_id)
 
327
                    self.to_file.write('#       %s\t%s\n' % (p_id, p_sha1))
323
328
            if rev.message and rev.message != self.message:
324
329
                self.to_file.write('#    message:\n')
325
330
                for line in rev.message.split('\n'):