Re: [fossil-users] Know when some files have been modified
On Fri, Nov 19, 2010 at 10:17:54AM -0500, Richard Hipp wrote: 2010/11/19 Lluís Batlle i Rossell virik...@gmail.com On Fri, Nov 19, 2010 at 10:03:48AM -0500, Richard Hipp wrote: 2010/11/19 Lluís Batlle i Rossell virik...@gmail.com Hello, is there any way I can know the history of a file, You mean like this? http://www.fossil-scm.org/fossil/finfo?name=Makefile Exactly! Is there any way it can show only the changes previous to a given checkin? (and only ancestors, without whatever could have been done with that file in branches apart). Are you looking for an annotated file change history (the thing that Git calls blame)? Click on the annotate link in the file history. Example: http://www.fossil-scm.org/fossil/annotate?checkin=42a964c585fe40ccfilename=Makefile I know annotate... in fact until the answers in the list telling about 'finfo', I've been using annotate to know when a file changed. I was expecting a way to get the list of versions where I would have to test, if I want to do a dichotomic search between a 'working version' and a 'not working version', both in the same branch. So, the problem I'm facing now is that I have a module in a subdirectory, and I think that the module is failing. That module has been changed in branches, merged to trunk, some branches did not get merged... and I find it very hard to know where that module (a subdirectory full of files, any of them could have the error) has been changed, for let's say, 'trunk'. Do you have an idea of how I would have to do that kind of search? Regards, Lluís. ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Patch file in windows
Hi, When I create a patch file using fossil diff patch.txt the resulting file cannot be used for patching. It seems there is an extra 0D line separator (0d 0d 0a) for the actual source lines. (---, +++, @@ lines are OK). Fossil is not taking any steps to insert extra CR characters in the output. The output of fossil diff is generated using printf(). Do you suppose that the windows implementation of printf() is trying to be helpful by converting NL to CRNL? Yup. One of the benefits of using that OS. The patch file must have been written in text mode. Here are some references: Shedding some light on this, since I've also just been caught by it: If the file was checked into the repository with CRLF line endings, then diff.c:break_into_lines() preserves the CR on the end of each line. When preparing the diff for display diff.c:appendDiffLine() appends a \n to the end of the line, which is translated via STDOUT (which is a text mode stream) to \r\n, thus leading to \r\r\n in the output. In short, Fossil only works with binary files for checkout/commit, but assumes a Unix text file for diff, causing a CR to be part of the line being diff'ed rather than part of the EOL. One solution is to strip CR from the diff before displaying it: Index: src/diff.c === --- src/diff.c +++ src/diff.c @@ -558,10 +558,11 @@ diff_all(c); if( pOut ){ /* Compute a context diff if requested */ contextDiff(c, pOut, nContext); +blob_remove_cr(pOut); free(c.aFrom); free(c.aTo); free(c.aEdit); return 0; }else{ This works as expected in most cases, with the peculiar side-effect that if you convert a file from Unix (LF) to DOS (CRLF) line endings or vice versa the diff will show all lines changed, but applying it as a patch will result in no change (since the added/removed CR doesn't make it into the diff output). I think the above patch is what you want to do 99% of the time. Or that could just be me ;) Regards, Twylite ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users