Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 22054:ef0ee0c001bf
basefilectx: move isexec and islink from memfilectx
This will be used in the future for creating memctx objects from other
store-type objects, such as a patch store or even another context.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Fri, 25 Jul 2014 20:11:47 -0500 |
parents | 6be1e1dbe6a0 |
children | ba5fc3f81f15 |
comparison
equal
deleted
inserted
replaced
22053:4354b1e35f53 | 22054:ef0ee0c001bf |
---|---|
712 def isbinary(self): | 712 def isbinary(self): |
713 try: | 713 try: |
714 return util.binary(self.data()) | 714 return util.binary(self.data()) |
715 except IOError: | 715 except IOError: |
716 return False | 716 return False |
717 def isexec(self): | |
718 return 'x' in self.flags() | |
719 def islink(self): | |
720 return 'l' in self.flags() | |
717 | 721 |
718 def cmp(self, fctx): | 722 def cmp(self, fctx): |
719 """compare with other file context | 723 """compare with other file context |
720 | 724 |
721 returns True if different than fctx. | 725 returns True if different than fctx. |
1654 return self._data | 1658 return self._data |
1655 def size(self): | 1659 def size(self): |
1656 return len(self.data()) | 1660 return len(self.data()) |
1657 def flags(self): | 1661 def flags(self): |
1658 return self._flags | 1662 return self._flags |
1659 def isexec(self): | |
1660 return 'x' in self._flags | |
1661 def islink(self): | |
1662 return 'l' in self._flags | |
1663 def renamed(self): | 1663 def renamed(self): |
1664 return self._copied | 1664 return self._copied |