equal
deleted
inserted
replaced
2 # |
2 # |
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> |
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> |
4 # |
4 # |
5 # This software may be used and distributed according to the terms of the |
5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. |
6 # GNU General Public License version 2 or any later version. |
|
7 |
|
8 from node import hex |
|
9 import encoding |
|
10 |
|
11 def write(repo, branches, tip, tiprev): |
|
12 try: |
|
13 f = repo.opener("cache/branchheads", "w", atomictemp=True) |
|
14 f.write("%s %s\n" % (hex(tip), tiprev)) |
|
15 for label, nodes in branches.iteritems(): |
|
16 for node in nodes: |
|
17 f.write("%s %s\n" % (hex(node), encoding.fromlocal(label))) |
|
18 f.close() |
|
19 except (IOError, OSError): |
|
20 pass |