How are version control histories stored and calculated?

后端 未结 3 1423
孤城傲影
孤城傲影 2021-02-05 17:41

Consider this simple python code, which demonstrates a very simple version control design for a dictonary:

def build_current(history):
    current = {}
    for a         


        
3条回答
  •  时光取名叫无心
    2021-02-05 18:19

    I think subversion made some attempts at backwards build. But I can explain what I know better: Mercurial snapshots.

    Mercurial uses a forward build scheme. But in order for each revision to be easily rebuildable, there are resync points: every time the size of all the deltas needed to rebuild a revision is bigger than two times the full text, a full text version (a compressed snapshot) is stored and all subsequent delta are computed relative to this new snapshot.

    This means that you never need to read more than 3 times the size of the text to retrieve any revision.

    You can find more details in the Hg Book.

提交回复
热议问题