Why commit don't commit files in alphabetical order?

John Arbash Meinel john at arbash-meinel.com
Thu Oct 8 15:18:54 BST 2009


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

Alexander Belchenko wrote:
> I just wonder what reasons of this behavior: status shows changes in
> alphabetical order, but commit is not. It's SO strange. Why?
> 
> C:\work\MyCode\trunk>bzr st
> modified:
>   host.c
>   host.h
>   i2c.c
>   i2c.h
>   main.c
>   packets.h
>   version.h
> 
> C:\work\MyCode\trunk>bzr qci
> Committing to: C:/work/MyCode/trunk/
> modified host.c
> modified host.h
> modified packets.h
> modified i2c.c
> modified version.h
> modified main.c
> modified i2c.h
> Committed revision 10.
> 

Alexander and I dug into this, and it is because commit is layered on
top of iter_changes, and uses 'osutils.minimum_path_selection'.

minimum_path_selection sorts everything, but then returns a 'set'. And
iter_changes uses that set and just does 'set.pop()' repeatedly to get
the items out. With a comment:
    # TODO: the pending list should be lexically sorted?  the
    # interface doesn't require it.
    try:
        self.current_root = self.search_specific_files.pop()
    except KeyError:
        raise StopIteration()


We're currently discussing the best way forward.

John
=:->

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

iEYEARECAAYFAkrN9M4ACgkQJdeBCYSNAANuugCgjUd5ATSPTDDf90Nlq5fk08Ze
w4kAnipZ4PqoMV9oU7c9Az0DKgbwkHcG
=ZwCB
-----END PGP SIGNATURE-----



More information about the bazaar mailing list