i am currently coding a simple Node.js based revision system: just commit,brunch and revert nothing fancy, just an exercise to keep skills in shape. I am using sqlite as data-backend with following simple shema:
commitid int
parentid int
branch text
diff blob
Now when I switch branches, I would need to traverse all the commits and apply the diffs on top on each other, this might work fine for 10 commits but with 1000 this will for sure take some time. Other systems like Hg or git switch branches within seconds, and (actual question) I wonder if them keep some kind of cache like every 100 commits, or how else is this handled?
Well, one thing for sure is that, in git:
Also, the blob in git is not the diff, but the full file; but as far as I know, hg keeps the diff.