3 ms·
Forget rename detection; it doesn't do renames period. So if you rename a file in one branch, you need to rename the file in the other branch BEFORE the merge,
by gecko 16y ago
Forget rename detection; it doesn't do renames period. So if you rename a file in one branch, you need to rename the file in the other branch BEFORE the merge, or you'll simply end up with two different files with different names.
- zedshaw 16y agoSigh, bullshit. I do this every day and it's just fine. You must be referring to some other concept of rename in some bizarrely complicated configuration you've worked yourself into.
- gecko 16y agoI am referring to this sequence: gozer:~$ fossil new zed.fsl project-id: e4549d02538b1b58cf28488f76fc7549dc11a752 server-id: 0bb5e1159eef42ed514c6ec13d17ba05f21ecdea admin-user: benjamin (initial password is "068bda") gozer:~$ mkdir zed gozer:~$ cd zed gozer:~/zed$ fossil open ../zed.fsl gozer:~/zed$ echo hello > hello.txt gozer:~/zed$ fossil commit -m "initial" fossil: nothing has changed gozer:~/zed$ fossil add hello.txt ADDED hello.txt gozer:~/zed$ fossil commit -m "initial" New_Version: 10c3840dc611fdc22888571560b908f36e647e59 gozer:~/zed$ echo zed >> hello.txt gozer:~/zed$ fossil commit -m "edited" New_Version: 10aa55193ddd374a75d37508cbc8a09466a05019 gozer:~/zed$ fossil update 10c384 UPDATE hello.txt gozer:~/zed$ mv hello.txt hello2.txt gozer:~/zed$ fossil mv hello.txt hello2.txt RENAME hello.txt hello2.txt gozer:~/zed$ fossil commit -f -m "renamed" New_Version: 3c3253cbd31cbc479c888fb8b1f38a8a46d8d4d6 **** warning: a fork has occurred ***** gozer:~/zed$ fossil merge 10aa55 gozer:~/zed$ ls _FOSSIL_ hello2.txt manifest manifest.uuid gozer:~/zed$ cat hello2.txt hello And just to go the other direction, since some DVCSes behave differently if their parents are in a different order: gozer:~/zed$ fossil update 10aa55 ADD hello.txt REMOVE hello2.txt gozer:~/zed$ ls _FOSSIL_ hello.txt manifest manifest.uuid gozer:~/zed$ cat hello.txt hello zed gozer:~/zed$ fossil merge 3c3253 ADDED hello2.txt DELETE hello.txt gozer:~/zed$ cat hello2.txt hello Contrast this with Mercurial: gozer:~$ hg init zedhg gozer:~$ cd zedhg gozer:~/zedhg$ echo hello > hello.txt gozer:~/zedhg$ hg ci -Aminitial adding hello.txt gozer:~/zedhg$ echo zed >> hello.txt gozer:~/zedhg$ hg ci -medited gozer:~/zedhg$ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved gozer:~/zedhg$ hg mv hello.txt hello2.txt gozer:~/zedhg$ hg addremove -s100 recording removal of hello.txt as rename to hello2.txt (100% similar) gozer:~/zedhg$ hg ci -mrenamed created new head gozer:~/zedhg$ hg merge merging hello2.txt and hell.txt to hello2.txt 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) gozer:~/zedhg$ cat hello2.txt hello zed Git and Bazaar work similarly. This can come up very easily early in a product cycle--doubly so if you have the misfortune of working on a Java project where people are refactoring often.