mercurial/mdiff.py
changeset 17941 9a6e4d5d7ea8
parent 17940 c84ef0047a94
child 17946 1e13b1184292
equal deleted inserted replaced
17940:c84ef0047a94 17941:9a6e4d5d7ea8
   141                 if old == new:
   141                 if old == new:
   142                     type = '~'
   142                     type = '~'
   143             yield s, type
   143             yield s, type
   144         yield s1, '='
   144         yield s1, '='
   145 
   145 
   146 def diffline(revs, a, b, opts):
       
   147     parts = ['diff']
       
   148     if opts.git:
       
   149         parts.append('--git')
       
   150     if revs and not opts.git:
       
   151         parts.append(' '.join(["-r %s" % rev for rev in revs]))
       
   152     if opts.git:
       
   153         parts.append('a/%s' % a)
       
   154         parts.append('b/%s' % b)
       
   155     else:
       
   156         parts.append(a)
       
   157     return ' '.join(parts) + '\n'
       
   158 
       
   159 def unidiff(a, ad, b, bd, fn1, fn2, opts=defaultopts):
   146 def unidiff(a, ad, b, bd, fn1, fn2, opts=defaultopts):
   160     def datetag(date, fn=None):
   147     def datetag(date, fn=None):
   161         if not opts.git and not opts.nodates:
   148         if not opts.git and not opts.nodates:
   162             return '\t%s\n' % date
   149             return '\t%s\n' % date
   163         if fn and ' ' in fn:
   150         if fn and ' ' in fn: