comparison svnexternals.py @ 175:2412800b1258

Support svn:externals changes via .hgsvnexternals updates
author Patrick Mezard <pmezard@gmail.com>
date Fri, 02 Jan 2009 15:54:05 -0600
parents f80132c5fea5
children 79349fd04836
comparison
equal deleted inserted replaced
174:f80132c5fea5 175:2412800b1258
55 line = line.rstrip('\n') 55 line = line.rstrip('\n')
56 if target is None or not line: 56 if target is None or not line:
57 continue 57 continue
58 self.setdefault(target, []).append(line[1:]) 58 self.setdefault(target, []).append(line[1:])
59 59
60 def diff(ext1, ext2):
61 """Compare 2 externalsfile and yield tuples like (dir, value1, value2)
62 where value1 is the external value in ext1 for dir or None, and
63 value2 the same in ext2.
64 """
65 for d in ext1:
66 if d not in ext2:
67 yield d, '\n'.join(ext1[d]), None
68 elif ext1[d] != ext2[d]:
69 yield d, '\n'.join(ext1[d]), '\n'.join(ext2[d])
70 for d in ext2:
71 if d not in ext1:
72 yield d, None, '\n'.join(ext2[d])