View | Details | Raw Unified | Return to bug 230021
Collapse All | Expand All

(-)bzr-fastimport/Makefile (-2 / +10 lines)
Lines 3-11 Link Here
3
3
4
PORTNAME=	bzr-fastimport
4
PORTNAME=	bzr-fastimport
5
PORTVERSION=	0.13.0
5
PORTVERSION=	0.13.0
6
PORTREVISION=	1
6
CATEGORIES=	devel
7
CATEGORIES=	devel
7
MASTER_SITES=	http://launchpadlibrarian.net/94774555/ \
8
MASTER_SITES=	${MASTER_SITE_DEBIAN_POOL}
8
		http://www.c-s.li/ports/
9
DISTNAME=	${PORTNAME}_${PORTVERSION}+bzr361
10
EXTRACT_SUFX=	.orig.tar.gz
9
11
10
MAINTAINER=	ports@FreeBSD.org
12
MAINTAINER=	ports@FreeBSD.org
11
COMMENT=	Provide fast loading of revision control data into bzr
13
COMMENT=	Provide fast loading of revision control data into bzr
Lines 19-22 Link Here
19
USES=		python:2.7
21
USES=		python:2.7
20
USE_PYTHON=	distutils autoplist
22
USE_PYTHON=	distutils autoplist
21
23
24
WRKSRC=		${WRKDIR}/${DISTNAME:S/_/-/}
25
PATCH_STRIP=	-p1
26
27
post-stage:
28
		${CHMOD} -R -P a+rX ${STAGEDIR}
29
22
.include <bsd.port.mk>
30
.include <bsd.port.mk>
(-)bzr-fastimport/distinfo (-2 / +3 lines)
Lines 1-2 Link Here
1
SHA256 (bzr-fastimport-0.13.0.tar.gz) = 5e296dc4ff8e9bf1b6447e81fef41e1217656b43368ee4056a1f024221e009eb
1
TIMESTAMP = 1532446385
2
SIZE (bzr-fastimport-0.13.0.tar.gz) = 80255
2
SHA256 (bzr-fastimport_0.13.0+bzr361.orig.tar.gz) = 7d9467175279dd2f7a92638aaeeba9874098db6d6bda2fa127722f449f80326d
3
SIZE (bzr-fastimport_0.13.0+bzr361.orig.tar.gz) = 81499
(-)bzr-fastimport/files/patch-deletion-case (+66 lines)
Line 0 Link Here
1
Description: Fix a case where deleteion of an entry in a renamed directory is not reproduced
2
 correctly in fast-export.  Thanks to Harry Hirsch, Nuno Araujo, and Andrew Huff for the patch.
3
Bugs: https://launchpad.net/bugs/430347 https://launchpad.net/bugs/1167690 https://launchpad.net/bugs/1014291
4
5
=== modified file 'exporter.py'
6
--- a/exporter.py	2014-05-15 09:26:03 +0000
7
+++ b/exporter.py	2015-05-04 13:08:57 +0000
8
@@ -514,6 +514,7 @@
9
         #
10
         # 1) bzr rm a; bzr mv b a; bzr commit
11
         # 2) bzr mv x/y z; bzr rm x; commmit
12
+        # 3) bzr mv x y; bzr rm y/z; bzr commit
13
         #
14
         # The first must come out with the delete first like this:
15
         #
16
@@ -525,6 +526,11 @@
17
         # R x/y z
18
         # D x
19
         #
20
+        # The third case must come out with delete first like this:
21
+        #
22
+        # D x/z
23
+        # R x y
24
+        #
25
         # So outputting all deletes first or all renames first won't work.
26
         # Instead, we need to make multiple passes over the various lists to
27
         # get the ordering right.
28
@@ -532,6 +538,7 @@
29
         must_be_renamed = {}
30
         old_to_new = {}
31
         deleted_paths = set([p for p, _, _ in deletes])
32
+        deleted_child_paths = set()
33
         for (oldpath, newpath, id_, kind,
34
                 text_modified, meta_modified) in renames:
35
             emit = kind != 'directory' or not self.plain_format
36
@@ -543,6 +550,20 @@
37
                 self.note("Skipping empty dir %s in rev %s" % (oldpath,
38
                     revision_id))
39
                 continue
40
+                
41
+            if kind == 'directory':
42
+                # handling deleted children in renamed directory (case 3 above)
43
+                for p, e in tree_old.inventory.iter_entries_by_dir(from_dir=id_):
44
+                    if e.kind == 'directory' or not self.plain_format:
45
+                        continue
46
+                    old_child_path = osutils.pathjoin(oldpath, p)
47
+                    new_child_path = osutils.pathjoin(newpath, p)
48
+                    if old_child_path in deleted_paths:
49
+                        file_cmds.append(commands.FileDeleteCommand(old_child_path.encode("utf-8")))
50
+                        deleted_paths.remove(old_child_path)
51
+                        deleted_child_paths.add(old_child_path)
52
+
53
+                
54
             #oldpath = self._adjust_path_for_renames(oldpath, renamed,
55
             #    revision_id)
56
             renamed.append([oldpath, newpath])
57
@@ -561,6 +582,8 @@
58
                         continue
59
                     old_child_path = osutils.pathjoin(oldpath, p)
60
                     new_child_path = osutils.pathjoin(newpath, p)
61
+                    if old_child_path in deleted_child_paths:
62
+                        continue
63
                     must_be_renamed[old_child_path] = new_child_path
64
 
65
         # Add children not already renamed
66
(-)bzr-fastimport/files/patch-disable-known-graph (+19 lines)
Line 0 Link Here
1
Description: Disable know graph feature.
2
 repo.get_known_graph_ancestry() can't be called while in the middle of a write
3
 group. Otherwise bzr will crash with: 'BTreeBuilder' object has no attribute
4
 '_find_ancestors'.
5
Author: Felipe Contreras <felipe.contreras@gmail.com>
6
Bug: https://launchpad.net/bugs/541626
7
Bug-Ubuntu: https://launchpad.net/bugs/541626
8
9
--- a/revision_store.py
10
+++ b/revision_store.py
11
@@ -170,7 +170,7 @@
12
         """
13
         self.repo = repo
14
         self._graph = None
15
-        self._use_known_graph = True
16
+        self._use_known_graph = False
17
         self._supports_chks = getattr(repo._format, 'supports_chks', False)
18
 
19
     def expects_rich_root(self):

Return to bug 230021