comparison mercurial/patch.py @ 17968:a9f4a6076740

subrepo: use posixpath when diffing, for consistent paths This fixes a Windows failure in test-subrepo-recursion.t introduced by c84ef0047a94.
author Bryan O'Sullivan <bryano@fb.com>
date Tue, 27 Nov 2012 14:58:00 -0800
parents 1e13b1184292
children b35e3364f94a
comparison
equal deleted inserted replaced
17967:0e2850a6fcdd 17968:a9f4a6076740
4 # Copyright 2007 Chris Mason <chris.mason@oracle.com> 4 # Copyright 2007 Chris Mason <chris.mason@oracle.com>
5 # 5 #
6 # This software may be used and distributed according to the terms of the 6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version. 7 # GNU General Public License version 2 or any later version.
8 8
9 import cStringIO, email.Parser, os, errno, re 9 import cStringIO, email.Parser, os, errno, re, posixpath
10 import tempfile, zlib, shutil 10 import tempfile, zlib, shutil
11 11
12 from i18n import _ 12 from i18n import _
13 from node import hex, nullid, short 13 from node import hex, nullid, short
14 import base85, mdiff, scmutil, util, diffhelpers, copies, encoding, error 14 import base85, mdiff, scmutil, util, diffhelpers, copies, encoding, error
1653 1653
1654 def trydiff(repo, revs, ctx1, ctx2, modified, added, removed, 1654 def trydiff(repo, revs, ctx1, ctx2, modified, added, removed,
1655 copy, getfilectx, opts, losedatafn, prefix): 1655 copy, getfilectx, opts, losedatafn, prefix):
1656 1656
1657 def join(f): 1657 def join(f):
1658 return os.path.join(prefix, f) 1658 return posixpath.join(prefix, f)
1659 1659
1660 def addmodehdr(header, omode, nmode): 1660 def addmodehdr(header, omode, nmode):
1661 if omode != nmode: 1661 if omode != nmode:
1662 header.append('old mode %s\n' % omode) 1662 header.append('old mode %s\n' % omode)
1663 header.append('new mode %s\n' % nmode) 1663 header.append('new mode %s\n' % nmode)