Paste #eaeoGONThMUuJiyqtm0e

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
diff -Nru bzr-fastimport-0.13.0/debian/changelog bzr-fastimport-0.13.0/debian/changelog
--- bzr-fastimport-0.13.0/debian/changelog	2014-10-10 11:05:11.000000000 -0400
+++ bzr-fastimport-0.13.0/debian/changelog	2015-05-04 10:39:27.000000000 -0400
@@ -1,3 +1,14 @@
+bzr-fastimport (0.13.0-4ubuntu2) wily; urgency=medium
+
+  * d/p/fix_deletion_case.patch (LP: #430347, LP: #1014291, LP: #1167690):
+    Fix a case where deleteion of an entry in a renamed directory is not
+    reproduced correctly in fast-export. Thanks to Harry Hirsch, Nuno Araujo,
+    and Andrew Huff.
+  * d/control: Build-depend on dh-python.
+  * Update standards-version to 3.9.6.
+
+ -- Unit 193 <unit193@ubuntu.com>  Mon, 04 May 2015 10:39:26 -0400
+
 bzr-fastimport (0.13.0-4ubuntu1) utopic; urgency=medium
 
   * d/patches/import-binary-stream.patch: Upstream patch to fixes an
diff -Nru bzr-fastimport-0.13.0/debian/control bzr-fastimport-0.13.0/debian/control
--- bzr-fastimport-0.13.0/debian/control	2014-10-10 10:23:49.000000000 -0400
+++ bzr-fastimport-0.13.0/debian/control	2015-05-04 09:23:58.000000000 -0400
@@ -5,11 +5,12 @@
 XSBC-Original-Maintainer: Debian QA Group <packages@qa.debian.org>
 Homepage: https://launchpad.net/bzr-fastimport
 Build-Depends-Indep: bzr (>= 1.0),
+                     dh-python,
                      python-bzrlib.tests | bzr (<< 2.4.0~beta1-2),
                      python-fastimport (>= 0.9.0~),
                      python-testtools
 Build-Depends: debhelper (>= 9), python (>= 2.6.6-3)
-Standards-Version: 3.9.4
+Standards-Version: 3.9.6
 X-Python-Version: >= 2.4
 Vcs-Bzr: http://anonscm.debian.org/bzr/pkg-bazaar/bzr-fastimport/unstable/
 XS-Testsuite: autopkgtest
diff -Nru bzr-fastimport-0.13.0/debian/patches/fix_deletion_case.patch bzr-fastimport-0.13.0/debian/patches/fix_deletion_case.patch
--- bzr-fastimport-0.13.0/debian/patches/fix_deletion_case.patch	1969-12-31 19:00:00.000000000 -0500
+++ bzr-fastimport-0.13.0/debian/patches/fix_deletion_case.patch	2015-05-04 09:16:01.000000000 -0400
@@ -0,0 +1,66 @@
+Description: Fix a case where deleteion of an entry in a renamed directory is not reproduced
+ correctly in fast-export.  Thanks to Harry Hirsch, Nuno Araujo, and Andrew Huff for the patch.
+Bugs: https://launchpad.net/bugs/430347 https://launchpad.net/bugs/1167690 https://launchpad.net/bugs/1014291
+
+=== modified file 'exporter.py'
+--- a/exporter.py	2014-05-15 09:26:03 +0000
++++ b/exporter.py	2015-05-04 13:08:57 +0000
+@@ -514,6 +514,7 @@
+         #
+         # 1) bzr rm a; bzr mv b a; bzr commit
+         # 2) bzr mv x/y z; bzr rm x; commmit
++        # 3) bzr mv x y; bzr rm y/z; bzr commit
+         #
+         # The first must come out with the delete first like this:
+         #
+@@ -525,6 +526,11 @@
+         # R x/y z
+         # D x
+         #
++        # The third case must come out with delete first like this:
++        #
++        # D x/z
++        # R x y
++        #
+         # So outputting all deletes first or all renames first won't work.
+         # Instead, we need to make multiple passes over the various lists to
+         # get the ordering right.
+@@ -532,6 +538,7 @@
+         must_be_renamed = {}
+         old_to_new = {}
+         deleted_paths = set([p for p, _, _ in deletes])
++        deleted_child_paths = set()
+         for (oldpath, newpath, id_, kind,
+                 text_modified, meta_modified) in renames:
+             emit = kind != 'directory' or not self.plain_format
+@@ -543,6 +550,20 @@
+                 self.note("Skipping empty dir %s in rev %s" % (oldpath,
+                     revision_id))
+                 continue
++                
++            if kind == 'directory':
++                # handling deleted children in renamed directory (case 3 above)
++                for p, e in tree_old.inventory.iter_entries_by_dir(from_dir=id_):
++                    if e.kind == 'directory' or not self.plain_format:
++                        continue
++                    old_child_path = osutils.pathjoin(oldpath, p)
++                    new_child_path = osutils.pathjoin(newpath, p)
++                    if old_child_path in deleted_paths:
++                        file_cmds.append(commands.FileDeleteCommand(old_child_path.encode("utf-8")))
++                        deleted_paths.remove(old_child_path)
++                        deleted_child_paths.add(old_child_path)
++
++                
+             #oldpath = self._adjust_path_for_renames(oldpath, renamed,
+             #    revision_id)
+             renamed.append([oldpath, newpath])
+@@ -561,6 +582,8 @@
+                         continue
+                     old_child_path = osutils.pathjoin(oldpath, p)
+                     new_child_path = osutils.pathjoin(newpath, p)
++                    if old_child_path in deleted_child_paths:
++                        continue
+                     must_be_renamed[old_child_path] = new_child_path
+ 
+         # Add children not already renamed
+
diff -Nru bzr-fastimport-0.13.0/debian/patches/series bzr-fastimport-0.13.0/debian/patches/series
--- bzr-fastimport-0.13.0/debian/patches/series	2014-10-10 10:24:08.000000000 -0400
+++ bzr-fastimport-0.13.0/debian/patches/series	2015-05-04 09:14:19.000000000 -0400
@@ -2,3 +2,4 @@
 improve_error_message.diff
 disable-known-graph-feature.patch
 import-binary-stream.patch
+fix_deletion_case.patch