##// END OF EJS Templates
patch: extract local function addmodehdr
Dirkjan Ochtman -
r7198:df79ee9b default
parent child Browse files
Show More
@@ -1166,6 +1166,11 b' def b85diff(to, tn):'
1166 ret.append('\n')
1166 ret.append('\n')
1167 return ''.join(ret)
1167 return ''.join(ret)
1168
1168
1169 def _addmodehdr(header, omode, nmode):
1170 if omode != nmode:
1171 header.append('old mode %s\n' % omode)
1172 header.append('new mode %s\n' % nmode)
1173
1169 def diff(repo, node1=None, node2=None, match=None,
1174 def diff(repo, node1=None, node2=None, match=None,
1170 fp=None, changes=None, opts=None):
1175 fp=None, changes=None, opts=None):
1171 '''print diff of changes to files between two nodes, or node and
1176 '''print diff of changes to files between two nodes, or node and
@@ -1230,17 +1235,12 b' def diff(repo, node1=None, node2=None, m'
1230 tn = getfilectx(f, ctx2).data()
1235 tn = getfilectx(f, ctx2).data()
1231 a, b = f, f
1236 a, b = f, f
1232 if opts.git:
1237 if opts.git:
1233 def addmodehdr(header, omode, nmode):
1234 if omode != nmode:
1235 header.append('old mode %s\n' % omode)
1236 header.append('new mode %s\n' % nmode)
1237
1238 if f in added:
1238 if f in added:
1239 mode = gitmode[ctx2.flags(f)]
1239 mode = gitmode[ctx2.flags(f)]
1240 if f in copy:
1240 if f in copy:
1241 a = copy[f]
1241 a = copy[f]
1242 omode = gitmode[man1.flags(a)]
1242 omode = gitmode[man1.flags(a)]
1243 addmodehdr(header, omode, mode)
1243 _addmodehdr(header, omode, mode)
1244 if a in removed and a not in gone:
1244 if a in removed and a not in gone:
1245 op = 'rename'
1245 op = 'rename'
1246 gone[a] = 1
1246 gone[a] = 1
@@ -1263,7 +1263,7 b' def diff(repo, node1=None, node2=None, m'
1263 else:
1263 else:
1264 omode = gitmode[man1.flags(f)]
1264 omode = gitmode[man1.flags(f)]
1265 nmode = gitmode[ctx2.flags(f)]
1265 nmode = gitmode[ctx2.flags(f)]
1266 addmodehdr(header, omode, nmode)
1266 _addmodehdr(header, omode, nmode)
1267 if util.binary(to) or util.binary(tn):
1267 if util.binary(to) or util.binary(tn):
1268 dodiff = 'binary'
1268 dodiff = 'binary'
1269 r = None
1269 r = None
General Comments 0
You need to be logged in to leave comments. Login now