Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 24371:8a997bd73448
patch.trydiff: add a docstring
It took me a bit to figure out what this function actually does.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 17 Mar 2015 13:06:15 -0700 |
parents | 31edcea517c1 |
children | 885a573fa619 |
comparison
equal
deleted
inserted
replaced
24370:3e8b06097d00 | 24371:8a997bd73448 |
---|---|
2224 continue | 2224 continue |
2225 yield f1, f2, copyop | 2225 yield f1, f2, copyop |
2226 | 2226 |
2227 def trydiff(repo, revs, ctx1, ctx2, modified, added, removed, | 2227 def trydiff(repo, revs, ctx1, ctx2, modified, added, removed, |
2228 copy, getfilectx, opts, losedatafn, prefix): | 2228 copy, getfilectx, opts, losedatafn, prefix): |
2229 '''given input data, generate a diff and yield it in blocks | |
2230 | |
2231 If generating a diff would lose data like flags or binary data and | |
2232 losedatafn is not None, it will be called. | |
2233 | |
2234 prefix is added to every path in the diff output.''' | |
2229 | 2235 |
2230 def gitindex(text): | 2236 def gitindex(text): |
2231 if not text: | 2237 if not text: |
2232 text = "" | 2238 text = "" |
2233 l = len(text) | 2239 l = len(text) |