[MERGE] Push honours 'no-working-trees' setting of repositories (#50582)
Alexander Belchenko
bialix at ukr.net
Fri Oct 5 04:07:42 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley пишет:
> Alexander Belchenko wrote:
>> The bug fixed by making clone of working tree conditional,
>> based on destination repo settings.
>
> bb:resubmit
>
> === modified file 'bzrlib/bzrdir.py'
> --- bzrlib/bzrdir.py 2007-09-21 07:29:37 +0000
> +++ bzrlib/bzrdir.py 2007-10-01 00:13:51 +0000
> @@ -208,10 +208,11 @@
> self.open_branch().clone(result, revision_id=revision_id)
> except errors.NotBranchError:
> pass
> - try:
> - self.open_workingtree().clone(result)
> - except (errors.NoWorkingTree, errors.NotLocalUrl):
> - pass
> + if result_repo.make_working_trees():
>
> ^^^ result_repo is not always set, so this will throw NameError in some
> cases.
Hmm, and in which situation there will be no result_repo?
As I can see it's possible only if local_repo is not found
by this code:
try:
local_repo = self.find_repository()
except errors.NoRepositoryPresent:
local_repo = None
What it means? And how I will know is target repo allow trees or not?
>
> === modified file 'bzrlib/tests/blackbox/test_push.py'
> --- bzrlib/tests/blackbox/test_push.py 2007-06-27 19:13:50 +0000
> +++ bzrlib/tests/blackbox/test_push.py 2007-10-01 00:13:51 +0000
>
> ^^^^ a blackbox test is fine, but there should be a Bzrdir.clone test.
Where is appropriate place for such test?
>
>
> + self.failIfExists([
> + 'repo/branch/.bzr/checkout',
> + 'repo/branch/a',
> + ])
>
> I don't think you should check for a particular file-- this is
> format-dependant. Instead, try opening a working tree, and assert that
> it raises.
like this:
self.assertRaises(NoWorkingTree, open_workingtree('repo/branch'))
?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHBap+zYr338mxwCURAn8eAKCTpdbrUMcUbTxApi9nS2JFo6ALWQCgjx5L
4RU8TodJgrwr2s77aSqPfC0=
=9qeO
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list