Merge lp:~mbp/bzr/408193-hardlink into lp:~bzr/bzr/trunk-old

Proposed by Martin Pool
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mbp/bzr/408193-hardlink
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 136 lines
To merge this branch: bzr merge lp:~mbp/bzr/408193-hardlink
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+9567@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

See bug 408193:

The attached branch https://code.launchpad.net/~mbp/bzr/408193-hardlink

 * gives a warning if hardlinking won't be done
 * turns the tests into KnownFailure if they see this message and hardlinking fails

Before actually reenabling the feature I'd like to talk to Ian and/or measure this possible performance loss.

Revision history for this message
Robert Collins (lifeless) wrote :

 review +1

I think its fine to not hardlink; bzr extracts texts _very_ fast from 2a
formats anyway.

-Rob

review: Approve
Revision history for this message
Martin Pool (mbp) wrote :

> review +1
>
> I think its fine to not hardlink; bzr extracts texts _very_ fast from 2a
> formats anyway.

As I said in the bug, users might want it for other reasons, like disk space. But it's not a high priority bug once this patch is in.

Thanks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2009-08-04 04:07:13 +0000
3+++ NEWS 2009-08-04 11:35:14 +0000
4@@ -107,6 +107,11 @@
5 imported. This caused significant slowdowns when reading data from
6 repositories. (Andrew Bennetts, #405653)
7
8+* The ``--hardlink`` option to ``branch`` and ``checkout`` is not
9+ supported at the moment on workingtree formats that can do content
10+ filtering. (See <https://bugs.edge.launchpad.net/bzr/+bug/408193>.)
11+ bzr now says so, rather than just ignoring the option. (Martin Pool)
12+
13 * There was a bug in ``osutils.relpath`` that was only triggered on
14 Windows. Essentially if you were at the root of a drive, and did
15 something to a branch/repo on another drive, we would go into an
16
17=== modified file 'bzrlib/bzrdir.py'
18--- bzrlib/bzrdir.py 2009-07-18 21:09:00 +0000
19+++ bzrlib/bzrdir.py 2009-08-04 11:35:14 +0000
20@@ -77,6 +77,7 @@
21 from bzrlib.trace import (
22 mutter,
23 note,
24+ warning,
25 )
26
27 from bzrlib import (
28@@ -1384,6 +1385,9 @@
29 # that can do wonky stuff here, and that only
30 # happens for creating checkouts, which cannot be
31 # done on this format anyway. So - acceptable wart.
32+ if hardlink:
33+ warning("can't support hardlinked working trees in %r"
34+ % (self,))
35 try:
36 result = self.open_workingtree(recommend_upgrade=False)
37 except errors.NoSuchFile:
38
39=== modified file 'bzrlib/tests/blackbox/test_branch.py'
40--- bzrlib/tests/blackbox/test_branch.py 2009-07-01 15:25:31 +0000
41+++ bzrlib/tests/blackbox/test_branch.py 2009-08-04 11:35:14 +0000
42@@ -22,7 +22,10 @@
43 from bzrlib import (branch, bzrdir, errors, repository)
44 from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1
45 from bzrlib.tests.blackbox import ExternalBase
46-from bzrlib.tests import HardlinkFeature
47+from bzrlib.tests import (
48+ KnownFailure,
49+ HardlinkFeature,
50+ )
51 from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
52 from bzrlib.urlutils import local_path_to_url, strip_trailing_slash
53 from bzrlib.workingtree import WorkingTree
54@@ -93,10 +96,18 @@
55 self.build_tree(['source/file1'])
56 source.add('file1')
57 source.commit('added file')
58- self.run_bzr(['branch', 'source', 'target', '--hardlink'])
59+ out, err = self.run_bzr(['branch', 'source', 'target', '--hardlink'])
60 source_stat = os.stat('source/file1')
61 target_stat = os.stat('target/file1')
62- self.assertEqual(source_stat, target_stat)
63+ same_file = (source_stat == target_stat)
64+ if same_file:
65+ pass
66+ else:
67+ # https://bugs.edge.launchpad.net/bzr/+bug/408193
68+ self.assertContainsRe(err, "hardlinking working copy files is "
69+ "not currently supported")
70+ raise KnownFailure("--hardlink doesn't work in formats "
71+ "that support content filtering (#408193)")
72
73 def test_branch_standalone(self):
74 shared_repo = self.make_repository('repo', shared=True)
75
76=== modified file 'bzrlib/tests/blackbox/test_checkout.py'
77--- bzrlib/tests/blackbox/test_checkout.py 2009-03-23 14:59:43 +0000
78+++ bzrlib/tests/blackbox/test_checkout.py 2009-08-04 11:35:14 +0000
79@@ -1,4 +1,4 @@
80-# Copyright (C) 2005, 2006 Canonical Ltd
81+# Copyright (C) 2005, 2006, 2009 Canonical Ltd
82 #
83 # This program is free software; you can redistribute it and/or modify
84 # it under the terms of the GNU General Public License as published by
85@@ -28,8 +28,13 @@
86 errors,
87 workingtree,
88 )
89-from bzrlib.tests.blackbox import ExternalBase
90-from bzrlib.tests import HardlinkFeature
91+from bzrlib.tests.blackbox import (
92+ ExternalBase,
93+ )
94+from bzrlib.tests import (
95+ HardlinkFeature,
96+ KnownFailure,
97+ )
98
99
100 class TestCheckout(ExternalBase):
101@@ -150,8 +155,17 @@
102 self.build_tree(['source/file1'])
103 source.add('file1')
104 source.commit('added file')
105- self.run_bzr(['checkout', 'source', 'target', '--files-from', 'source',
106- '--hardlink'])
107+ out, err = self.run_bzr(['checkout', 'source', 'target',
108+ '--files-from', 'source',
109+ '--hardlink'])
110 source_stat = os.stat('source/file1')
111 target_stat = os.stat('target/file1')
112- self.assertEqual(source_stat, target_stat)
113+ same_file = (source_stat == target_stat)
114+ if same_file:
115+ pass
116+ else:
117+ # https://bugs.edge.launchpad.net/bzr/+bug/408193
118+ self.assertContainsRe(err, "hardlinking working copy files is "
119+ "not currently supported")
120+ raise KnownFailure("--hardlink doesn't work in formats "
121+ "that support content filtering (#408193)")
122
123=== modified file 'bzrlib/workingtree_4.py'
124--- bzrlib/workingtree_4.py 2009-07-17 06:04:35 +0000
125+++ bzrlib/workingtree_4.py 2009-08-04 11:35:14 +0000
126@@ -1423,6 +1423,10 @@
127 # applied so we can't safely build the inventory delta from
128 # the source tree.
129 if wt.supports_content_filtering():
130+ if hardlink:
131+ # see https://bugs.edge.launchpad.net/bzr/+bug/408193
132+ trace.warning("hardlinking working copy files is not currently "
133+ "supported in %r" % (wt,))
134 accelerator_tree = None
135 delta_from_tree = False
136 else: