On Friday, August 24, 2012 10:35 PM, Richard Hipp wrote:
> Fossil keeps track of which files have changed (by default) by looking
> at the file size and the mtime.  If neither the file size nor the mtime
> have changed, fossil (by default) assumes that the content of the file
> is also unchanged.
>
> Perhaps your edit somehow preserved both the file size and mtime and so
> Fossil didn't realize that the file had been editing as it started the
> commit.
>
> If that ever happens, you can always fix it by doing:
>
>    fossil status --sha1sum
>
> You can also do "fossil setting mtime-changes off" and afterwards Fossil
> will always check the complete file content rather than relying on the
> mtime and file size.  That will be a little slower, but it avoids
> confusion such as the above.

Thanks for the pointers, I've managed to get a commit through!

I've looked a little more into how the problem came about:

I had merged a branch into trunk, then modified quite a number of the
files prior to commit.  Among these, one was a new file created during
the branch.  This one was modified but fossil status showed ADDED_BY_MERGE
rather than EDITED.  What didn't help was that it was modified, not by
hand but by overwriting it with a copy from a backup folder -- this meant
that it had a timestamp older than the version merged by fossil (but you
were right: by coincidence, the file size *was* the same).

(So when I said, I'd not done anything out of the ordinary, I'm afraid I
was not so accurate -- I had forgotten all these things, my apologies!)

So, anyway, I tried your suggestion re "fossil status --sha1sum" but this
didn't work.  I also tried "touching" the file to give it a more recent
timestamp -- this also didn't work.  I also tried the "fossil setting..."
but this didn't help directly (but I've left it on for the future!).

I also tried modifying the file in a random location (not totally random,
but one of the changes made, I un-made), but this didn't cause fossil to
realise the file had been modified -- this surprised me.

I then modified the *first* line of the file, and then did a "fossil
status" and *now* the file was marked as "EDITED" so I unmodified the
first line, and was able to make the commit without error.

So, thanks again for the help: I know what to do next time! (as does
anyone else who stumbles across this thread with the same problem!)

I am certainly glad of the backup check, though, since otherwise I
may have ended up with an incorrect commit and never realised :o)

Cheers
Andy




_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to