Move detection – advanced bitsMove 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 worksThe 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 complicatedWhat if foo.c is something like the following?
And we rename it to bar.c and modify it this way:
As you can see plastic detects a “potential add” and a “potential delete”.
Matching manuallyRight 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: