~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: Martin Pool
  • Date: 2007-10-09 02:42:02 UTC
  • mto: This revision was merged to the branch mainline in revision 2899.
  • Revision ID: mbp@sourcefrog.net-20071009024202-3t29natdi3lvwenl
Use cmp_by_dirs in set_state_from_inventory rather than hardcoding the equivalent

Show diffs side-by-side

added added

removed removed

Lines of Context:
1895
1895
                new_dirname, new_basename = osutils.split(new_path_utf8)
1896
1896
                new_id = current_new[1].file_id
1897
1897
                new_entry_key = (new_dirname, new_basename, new_id)
1898
 
                new_dir_parts = new_dirname.split('/')
1899
1898
                current_new_minikind = \
1900
1899
                    DirState._kind_to_minikind[current_new[1].kind]
1901
1900
                if current_new_minikind == 't':
1909
1908
            else:
1910
1909
                # for safety disable variables
1911
1910
                new_path_utf8 = new_dirname = new_basename = new_id = \
1912
 
                    new_entry_key = new_dir_parts = None
 
1911
                    new_entry_key = None
1913
1912
            # 5 cases, we dont have a value that is strictly greater than everything, so
1914
1913
            # we make both end conditions explicit
1915
1914
            if current_old is None:
1938
1937
                # both sides are dealt with, move on
1939
1938
                current_old = advance(old_iterator)
1940
1939
                current_new = advance(new_iterator)
1941
 
            elif (new_dir_parts < current_old[0][0].split('/')
 
1940
            elif (cmp_by_dirs(new_dirname, current_old[0][0]) < 0
1942
1941
                  or (new_dirname == current_old[0][0]
1943
1942
                      and new_entry_key[1:] < current_old[0][1:])):
1944
1943
                # new comes before: