Merge lp://qastaging/~mnn282/bzr/auto-rename-fix into lp://qastaging/bzr

Proposed by mnn
Status: Needs review
Proposed branch: lp://qastaging/~mnn282/bzr/auto-rename-fix
Merge into: lp://qastaging/bzr
Diff against target: 51 lines (+25/-1)
2 files modified
bzrlib/rename_map.py (+8/-1)
bzrlib/tests/test_rename_map.py (+17/-0)
To merge this branch: bzr merge lp://qastaging/~mnn282/bzr/auto-rename-fix
Reviewer Review Type Date Requested Status
Martin Packman (community) Approve
bzr-core Pending
Review via email: mp+117203@code.qastaging.launchpad.net

Description of the change

Fixed bug with RenameMap (bzr move --auto), also RenameMap has ability to detect files moved into new unversioned directories.

To post a comment you must log in.
6549. By mnn

Simplified test_guess_rename_handles_new_directories

Revision history for this message
Martin Packman (gz) wrote :

Thanks for working on this!

I'm still a little uncertain on the core logic here, will look again later.

+ if self.tree.has_filename(self.tree.id2path(parent[0])) == False:

Normal style is not to compare against booleans, just use `if not condition` instead.

+ self.assertEqual('added:\n folder/\nrenamed:\n file => folder/file2\n',
+ self.run_bzr("status")[0])

At this level, in bzrlib.tests rather than bzrlib.tests.blackbox, you really want to be writing assertions based on api calls rather than the commandline ui. Mostly this just confirms the check above, but adding an assertion for the current tree shape does seem reasonable.

I see you've already fixed the other style stuff I mentioned on IRC, thanks!

review: Approve

Unmerged revisions

6549. By mnn

Simplified test_guess_rename_handles_new_directories

6548. By mnn

Fixed issue with RenameMap - also it supports renaming into new unversioned directory

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.