##// END OF EJS Templates
shelve: add an ability to write key-val data to a new type of shelve files...
shelve: add an ability to write key-val data to a new type of shelve files Obsolescense-based shelve only needs metadata stored in .hg/shelved and if feels that this metadata should be stored in a simplekeyvaluefile format for potential extensibility purposes. I want to avoid storing it in an unstructured text file where order of lines determines their semantical meanings (as now happens in .hg/shelvedstate. .hg/rebasestate and I suspect other state files as well). Not included in this series, I have ~30 commits, doubling test-shelve.t in size and testing almost every tested shelve usecase for obs-shelve. Here's the series for the curious now: http://pastebin.com/tGJKx0vM I would like to send it to the mailing list and get accepted as well, but: 1. it's big, so should I send like 6 patches a time or so? 2. instead of having a commit per test case, it more like a commit per some amount of copy-pasted code. I tried to keep it meaningful and named commits somewhat properly, but it is far from this list standards IMO. Any advice on how to get it in without turning it into a 100 commits and spending many days writing descriptions? 3. it makes test-shelve.t run for twice as long (and it is already a slow test). Newest test-shelve.r runs for ~1 minute.

File last commit:

r30346:9cc438bf default
r31554:7485e458 default
Show More
bdiff.py
31 lines | 716 B | text/x-python | PythonLexer
from __future__ import absolute_import
import cffi
import os
ffi = cffi.FFI()
ffi.set_source("_bdiff_cffi",
open(os.path.join(os.path.join(os.path.dirname(__file__), '..'),
'bdiff.c')).read(), include_dirs=['mercurial'])
ffi.cdef("""
struct bdiff_line {
int hash, n, e;
ssize_t len;
const char *l;
};
struct bdiff_hunk;
struct bdiff_hunk {
int a1, a2, b1, b2;
struct bdiff_hunk *next;
};
int bdiff_splitlines(const char *a, ssize_t len, struct bdiff_line **lr);
int bdiff_diff(struct bdiff_line *a, int an, struct bdiff_line *b, int bn,
struct bdiff_hunk *base);
void bdiff_freehunks(struct bdiff_hunk *l);
void free(void*);
""")
if __name__ == '__main__':
ffi.compile()