Mercurial > public > mercurial-scm > hg
comparison mercurial/patch.py @ 19876:7032dcff290c
merge with stable
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Mon, 07 Oct 2013 17:47:55 -0400 |
parents | c80feeb715d1 c172660eee01 |
children | 1184edaead7a |
comparison
equal
deleted
inserted
replaced
19874:5836edcbdc2e | 19876:7032dcff290c |
---|---|
12 # load. This was not a problem on Python 2.7. | 12 # load. This was not a problem on Python 2.7. |
13 import email.Generator | 13 import email.Generator |
14 import email.Parser | 14 import email.Parser |
15 | 15 |
16 from i18n import _ | 16 from i18n import _ |
17 from node import hex, nullid, short | 17 from node import hex, short |
18 import base85, mdiff, scmutil, util, diffhelpers, copies, encoding, error | 18 import base85, mdiff, scmutil, util, diffhelpers, copies, encoding, error |
19 import context | 19 import context |
20 | 20 |
21 gitre = re.compile('diff --git a/(.*) b/(.*)') | 21 gitre = re.compile('diff --git a/(.*) b/(.*)') |
22 | 22 |
1660 elif i==3: | 1660 elif i==3: |
1661 meta.append('index %s,%s..%s\n' % tuple(revs)) | 1661 meta.append('index %s,%s..%s\n' % tuple(revs)) |
1662 | 1662 |
1663 def gitindex(text): | 1663 def gitindex(text): |
1664 if not text: | 1664 if not text: |
1665 return hex(nullid) | 1665 text = "" |
1666 l = len(text) | 1666 l = len(text) |
1667 s = util.sha1('blob %d\0' % l) | 1667 s = util.sha1('blob %d\0' % l) |
1668 s.update(text) | 1668 s.update(text) |
1669 return s.hexdigest() | 1669 return s.hexdigest() |
1670 | 1670 |