[Pkg-bazaar-commits] ./bzr-builddeb/trunk.old r275: Handle unknown files in trees we are using to take new file ids from.

James Westby jw+debian at jameswestby.net
Wed Dec 10 08:33:05 UTC 2008


------------------------------------------------------------
revno: 275
committer: James Westby <jw+debian at jameswestby.net>
branch nick: trunk
timestamp: Tue 2008-09-09 21:46:02 +0100
message:
  Handle unknown files in trees we are using to take new file ids from.
  
  When importing a new version we take file ids from other trees. If there
  is an unknown file in a working tree we are using for one of those trees
  it will be reported as present, but the file-id will be None, and so
  we shouldn't use it. (#264704)
modified:
  import_dsc.py
-------------- next part --------------
=== modified file 'import_dsc.py'
--- a/import_dsc.py	2008-09-05 12:33:02 +0000
+++ b/import_dsc.py	2008-09-09 20:46:02 +0000
@@ -263,10 +263,10 @@
             for other_tree in file_ids_from:
                 if other_tree.has_filename(relative_path):
                     file_id = other_tree.path2id(relative_path)
-                    assert file_id is not None
-                    tt.version_file(file_id, trans_id)
-                    found = True
-                    break
+                    if file_id is not None:
+                        tt.version_file(file_id, trans_id)
+                        found = True
+                        break
             if not found:
                 name = basename(member.name.rstrip('/'))
                 file_id = generate_ids.gen_file_id(name)
@@ -283,10 +283,10 @@
             for other_tree in file_ids_from:
                 if other_tree.has_filename(relative_path):
                     file_id = other_tree.path2id(relative_path)
-                    assert file_id is not None
-                    tt.version_file(file_id, trans_id)
-                    found = True
-                    break
+                    if file_id is not None:
+                        tt.version_file(file_id, trans_id)
+                        found = True
+                        break
             if not found:
                 tt.version_file(trans_id, trans_id)
         added.add(relative_path)



More information about the Pkg-bazaar-commits mailing list