mercurial/dirstate.py
changeset 13047 6c375e07d673
parent 13032 e41e2b79883d
child 13200 6f011cf52f9a
equal deleted inserted replaced
13046:7cc4263e07a9 13047:6c375e07d673
     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 
     7 
     8 from node import nullid
     8 from node import nullid
     9 from i18n import _
     9 from i18n import _
    10 import util, ignore, osutil, parsers
    10 import util, ignore, osutil, parsers, encoding
    11 import struct, os, stat, errno
    11 import struct, os, stat, errno
    12 import cStringIO
    12 import cStringIO
    13 
    13 
    14 _format = ">cllll"
    14 _format = ">cllll"
    15 propertycache = util.propertycache
    15 propertycache = util.propertycache
   199 
   199 
   200     def parents(self):
   200     def parents(self):
   201         return [self._validate(p) for p in self._pl]
   201         return [self._validate(p) for p in self._pl]
   202 
   202 
   203     def branch(self):
   203     def branch(self):
   204         return self._branch
   204         return encoding.tolocal(self._branch)
   205 
   205 
   206     def setparents(self, p1, p2=nullid):
   206     def setparents(self, p1, p2=nullid):
   207         self._dirty = self._dirtypl = True
   207         self._dirty = self._dirtypl = True
   208         self._pl = p1, p2
   208         self._pl = p1, p2
   209 
   209 
   210     def setbranch(self, branch):
   210     def setbranch(self, branch):
   211         if branch in ['tip', '.', 'null']:
   211         if branch in ['tip', '.', 'null']:
   212             raise util.Abort(_('the name \'%s\' is reserved') % branch)
   212             raise util.Abort(_('the name \'%s\' is reserved') % branch)
   213         self._branch = branch
   213         self._branch = encoding.fromlocal(branch)
   214         self._opener("branch", "w").write(branch + '\n')
   214         self._opener("branch", "w").write(self._branch + '\n')
   215 
   215 
   216     def _read(self):
   216     def _read(self):
   217         self._map = {}
   217         self._map = {}
   218         self._copymap = {}
   218         self._copymap = {}
   219         try:
   219         try: