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

  • Committer: Aaron Bentley
  • Date: 2008-10-11 14:35:20 UTC
  • mto: (0.14.16 prepare-shelf)
  • mto: This revision was merged to the branch mainline in revision 3820.
  • Revision ID: aaron@aaronbentley.com-20081011143520-k7gxxyd0fp0dg7b5
Make get_parents_lines more robust

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import os
2
2
 
3
 
from bzrlib import multiparent
 
3
from bzrlib import errors, multiparent
4
4
from bzrlib.util import bencode
5
5
 
6
6
 
10
10
 
11
11
def get_parents_lines(tt, trans_id):
12
12
    file_id = tt.tree_file_id(trans_id)
13
 
    if file_id is None:
 
13
    try:
 
14
        if file_id is None or tt._tree.kind(file_id) != 'file':
 
15
            return ()
 
16
    except errors.NoSuchFile:
14
17
        return ()
15
 
    else:
16
 
        return (tt._tree.get_file(file_id).readlines(),)
 
18
    return (tt._tree.get_file(file_id).readlines(),)
17
19
 
18
20
 
19
21
def serialize(tt, serializer):