mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
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.
This commit is contained in:
parent
9ffafb4321
commit
5dc38028a3
@ -79,7 +79,7 @@ class localrepository(repo.repository):
|
||||
|
||||
self.sharedpath = self.path
|
||||
try:
|
||||
s = os.path.realpath(self.opener.read("sharedpath"))
|
||||
s = os.path.realpath(self.opener.read("sharedpath").rstrip('\n'))
|
||||
if not os.path.exists(s):
|
||||
raise error.RepoError(
|
||||
_('.hg/sharedpath points to nonexistent directory %s') % s)
|
||||
|
@ -28,6 +28,15 @@ Some sed versions appends newline, some don't, and some just fails
|
||||
$ cat .hg/sharedpath; echo
|
||||
$TESTTMP/repo1/.hg
|
||||
|
||||
trailing newline on .hg/sharedpath is ok
|
||||
$ hg tip -q
|
||||
0:d3873e73d99e
|
||||
$ echo '' >> .hg/sharedpath
|
||||
$ cat .hg/sharedpath
|
||||
$TESTTMP/repo1/.hg
|
||||
$ hg tip -q
|
||||
0:d3873e73d99e
|
||||
|
||||
commit in shared clone
|
||||
|
||||
$ echo a >> a
|
||||
|
Loading…
Reference in New Issue
Block a user