Mercurial > hg
comparison mercurial/patch.py @ 10746:16b9aa398c28
Merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 20 Mar 2010 10:01:56 -0500 |
parents | d794ea113834 d94832c4a31d |
children | 03225f14c495 |
comparison
equal
deleted
inserted
replaced
10744:d794ea113834 | 10746:16b9aa398c28 |
---|---|
931 goodb = not nullb and os.path.exists(bfile) | 931 goodb = not nullb and os.path.exists(bfile) |
932 createfunc = hunk.createfile | 932 createfunc = hunk.createfile |
933 missing = not goodb and not gooda and not createfunc() | 933 missing = not goodb and not gooda and not createfunc() |
934 | 934 |
935 # some diff programs apparently produce create patches where the | 935 # some diff programs apparently produce create patches where the |
936 # afile is not /dev/null, but rather the same name as the bfile | 936 # afile is not /dev/null, but afile starts with bfile |
937 if missing and afile == bfile: | 937 abasedir = afile[:afile.rfind('/') + 1] |
938 bbasedir = bfile[:bfile.rfind('/') + 1] | |
939 if missing and abasedir == bbasedir and afile.startswith(bfile): | |
938 # this isn't very pretty | 940 # this isn't very pretty |
939 hunk.create = True | 941 hunk.create = True |
940 if createfunc(): | 942 if createfunc(): |
941 missing = False | 943 missing = False |
942 else: | 944 else: |