commit with specified files does not go in lexicographical order

Bug #446382 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

If you do a regular 'bzr commit' then we iterate the filesystem in sorted order.

However, if you do "bzr commit foo bar baz" then we put those paths into a set (based on osutils.minimum_path_selection()) and then iterate that set (via .pop()). As such, the output of what files are being committed is random.
Even further, it probably walks the fs in a random order, which could probably be better.

It would seem that the best place to fix this would be in _dirstate_helpers_pyx.pyx to use a sorted "search_specific_files" list, rather than a set. Even further, osutils.minimum_path_selection already builds a sorted list (to make it cheaper to determine if a path is in the minimal set already). So we possibly could just return that. Callers that need a set could then do the work at that level instead.

Revision history for this message
Alexander Belchenko (bialix) wrote :

It seems like other clients of iter_changes like status and diff do sorting of results. So fixing iter_changes will benefits for them too.

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

Re: file system - we will be doing directory-at-a-time, and for that the order desired is disk order (that is /not/ lexographical).

Just sorting in memory, wherever, should be fine.

Jelmer Vernooij (jelmer)
tags: added: commit
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.