comparison mercurial/localrepo.py @ 15101:a21ccf4412d5

share: allow trailing newline on .hg/sharedpath. This is extremely handy for those occasional circumstances where you need to edit .hg/sharedpath manually, since modern Unix text editors make it surprisingly difficult to create a text file with no trailing newline.
author Greg Ward <greg@gerg.ca>
date Wed, 14 Sep 2011 22:28:27 -0400
parents cda7a87c1871
children 3d44e68360a6
comparison
equal deleted inserted replaced
15100:a051f8a6a7cc 15101:a21ccf4412d5
77 raise 77 raise
78 requirements = set() 78 requirements = set()
79 79
80 self.sharedpath = self.path 80 self.sharedpath = self.path
81 try: 81 try:
82 s = os.path.realpath(self.opener.read("sharedpath")) 82 s = os.path.realpath(self.opener.read("sharedpath").rstrip('\n'))
83 if not os.path.exists(s): 83 if not os.path.exists(s):
84 raise error.RepoError( 84 raise error.RepoError(
85 _('.hg/sharedpath points to nonexistent directory %s') % s) 85 _('.hg/sharedpath points to nonexistent directory %s') % s)
86 self.sharedpath = s 86 self.sharedpath = s
87 except IOError, inst: 87 except IOError, inst: