equal
deleted
inserted
replaced
816 |
816 |
817 |
817 |
818 class path(object): |
818 class path(object): |
819 """Represents an individual path and its configuration.""" |
819 """Represents an individual path and its configuration.""" |
820 |
820 |
821 def __init__(self, ui=None, name=None, rawloc=None, suboptions=None): |
821 def __init__( |
|
822 self, |
|
823 ui=None, |
|
824 name=None, |
|
825 rawloc=None, |
|
826 suboptions=None, |
|
827 validate_path=True, |
|
828 ): |
822 """Construct a path from its config options. |
829 """Construct a path from its config options. |
823 |
830 |
824 ``ui`` is the ``ui`` instance the path is coming from. |
831 ``ui`` is the ``ui`` instance the path is coming from. |
825 ``name`` is the symbolic name of the path. |
832 ``name`` is the symbolic name of the path. |
826 ``rawloc`` is the raw location, as defined in the config. |
833 ``rawloc`` is the raw location, as defined in the config. |
854 |
861 |
855 self.name = name |
862 self.name = name |
856 self.rawloc = rawloc |
863 self.rawloc = rawloc |
857 self.loc = b'%s' % u |
864 self.loc = b'%s' % u |
858 |
865 |
859 self._validate_path() |
866 if validate_path: |
|
867 self._validate_path() |
860 |
868 |
861 _path, sub_opts = ui.configsuboptions(b'paths', b'*') |
869 _path, sub_opts = ui.configsuboptions(b'paths', b'*') |
862 self._own_sub_opts = {} |
870 self._own_sub_opts = {} |
863 if suboptions is not None: |
871 if suboptions is not None: |
864 self._own_sub_opts = suboptions.copy() |
872 self._own_sub_opts = suboptions.copy() |