Move detection – advanced bits
Move detection is one of the big features in 4.0, as I’m sure you’re already aware of.It has been implemented on top of the same underlying technology we use for Xdiff and Xmerge.
The point is: you just move a file on your workspace without issuing a “cm mv” operation (command line, GUI or through a plugin), and later Plastic is able to “detect” the move happened.
How it works
The principles of move detection are quite easy: Plastic has a list of the files (stored under .plastic/plastic.wktree file on the workspace) that are “controlled” under the workspace. Then you decide to look for changes:How the “moves” are detected? The “added candidates” are matched with the “deleted candidates” and if they’re “similar enough” then they’re proposed as “moved”.
Let’s make it more complicated
What if foo.c is something like the following?And we rename it to bar.c and modify it this way:
The file was so small that this little change will make the two versions less than 90% different, so “pending changes” view will look like this:As you can see plastic detects a “potential add” and a “potential delete”.
Matching manually
Right click on the “potentially added” file and select “search matches”:And then the “matching” dialog will show up. You can slide the similarity bar until the candidate appears:
And once you “accept the selected match”, the “pending changes view” will reflect the move:
> "less than 90% different"
ReplyDeleteShouldn't that be reversed since the changes was to different to be detected as a move?