[MERGE] add -c option to merge command (#141368)

Alexander Belchenko bialix at ukr.net
Mon Sep 24 11:01:46 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ian Clatworthy пишет:
> Alexander Belchenko wrote:
>> Actually adding -c option was quite trivial, but as usual test for changes
>> is much bigger than actual changes.
> 
> Sweet.
> 
> bb:tweak
> 
> 
>> +    def assertDirectoryContent(self, directory, entries, message=''):
>> +        """Assert whether entries (files or directories) are exist
>> +        in some directory. It's also check that there is no extra
>> +        entries.
>> +        """
> 
> As this is an internal method, I'd prefer a leading underscore on the
> name. 

I disagree here. grep output for 'def .?assert' is very big and there are
a lot of Test* classes that define their own domain-specific assert methods.
And there are a lot methods without underscore in name and
only 2 methods with underscores:

bzrlib\tests\test_counted_lock.py:56:     def _assert_locked(self):
bzrlib\tests\test_counted_lock.py:60:     def _assert_not_locked(self):

> Some minor English grammar fixes needed as well. I suggest this ...

Thank you very much.

> 
> """Assert whether entries (file or directories) exist in a directory.
> 
> It also checks that there are no extra entries.
> """
> 
>> +        ondisk = sorted(os.listdir(directory))
>> +        if set(ondisk) == set(entries):
>> +            return
> 
> As you're comparing sets, I think the sorted() bit is not required. If
> you want to sort for the purposes of output, I'd sort after the return
> and sort both ondisk and entries.

OK, I'll move sorting down to the place where exception message is created.

[µ]


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG94sKzYr338mxwCURAqTjAJ0TG7u8vqoOeGmEzqhlLE1O4v0pUwCfSjNJ
cPUVps6kU5A+zP+vZfAUdWU=
=K9qn
-----END PGP SIGNATURE-----



More information about the bazaar mailing list