Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.6, 0.7, and 0.7.1

hg-crew-tip hggtk/changeset: fix gitmode()

Changeset c5cf2cb91390

Parent 84a89173b9a1

by Peter Arrenbrecht

Changes to one file · Browse files at c5cf2cb91390 Showing diff from parent 84a89173b9a1 Diff from another changeset...

 
246
247
248
249
250
 
251
252
253
 
315
316
317
318
319
 
 
320
321
322
323
324
325
326
 
327
328
329
 
330
331
332
 
344
345
346
347
 
348
349
350
351
 
 
352
353
354
 
246
247
248
 
 
249
250
251
252
 
314
315
316
 
 
317
318
319
320
321
322
323
324
 
325
326
327
 
328
329
330
331
 
343
344
345
 
346
347
348
 
 
349
350
351
352
353
@@ -246,8 +246,7 @@
  man1 = ctx1.manifest()   date1 = util.datestr(ctx1.date())   - execf2 = ctx2.manifest().execf - linkf2 = ctx2.manifest().linkf + flags2 = ctx2.manifest().flags     # returns False if there was no rename between ctx1 and ctx2   # returns None if the file was created between ctx1 and ctx2 @@ -315,18 +314,18 @@
  if s != 'R':   tn = getfilectx(f, ctx2).data()   a, b = f, f - def gitmode(x, l): - return l and '120000' or (x and '100755' or '100644') + def gitmode(flags): + return 'l' in flags or 'x' in flags   def addmodehdr(header, omode, nmode):   if omode != nmode:   header.append('old mode %s\n' % omode)   header.append('new mode %s\n' % nmode)     if s == 'A': - mode = gitmode(execf2(f), linkf2(f)) + mode = gitmode(flags2(f))   if f in copied:   a = copied[f] - omode = gitmode(man1.execf(a), man1.linkf(a)) + omode = gitmode(man1.flags(a))   addmodehdr(header, omode, mode)   if filestatus(a) == 'R' and a not in gone:   op = 'rename' @@ -344,11 +343,11 @@
  if f in srcs:   dodiff = False   else: - mode = gitmode(man1.execf(f), man1.linkf(f)) + mode = gitmode(man1.flags(f))   header.append('deleted file mode %s\n' % mode)   else: - omode = gitmode(man1.execf(f), man1.linkf(f)) - nmode = gitmode(execf2(f), linkf2(f)) + omode = gitmode(man1.flags(f)) + nmode = gitmode(flags2(f))   addmodehdr(header, omode, nmode)   if util.binary(to) or util.binary(tn):   dodiff = 'binary'