comparison tests/test-clone.t @ 17159:36a3016811d1

localrepo: use the path relative to "self.vfs" instead of "path" argument As a part of migration to vfs, this patch uses "self.root", which can be recognized as the path relative to "self.vfs", instead of "path" argument. This fix allows to make invocations of "util.makedirs()" and "os.path.exists()" while ensuring repository directory in "localrepository.__init__()" ones indirectly via vfs. But this fix also raises issue 2528: "hg clone" with empty destination. "path" argument is empty in many cases, so this issue can't be fixed in the view of "localrepository.__init__()". Before this patch, it is fixed by empty-ness check ("not name") of exception handler in "util.makedirs()". try: os.mkdir(name) except OSError, err: if err.errno == errno.EEXIST: return if err.errno != errno.ENOENT or not name: raise This requires "localrepository.__init__()" to invoke "util.makedirs()" with "path" instead of "self.root", because empty "path" is treated as "current directory" and "self.root" becomes valid path. But "hg clone" with empty destination can be detected also in "hg.clone()" before "localrepository.__init__()" invocation, so this patch re-fixes issue2528 by checking it in "hg.clone()".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 06 Jul 2012 18:45:27 +0900
parents 06733dfe1a43
children d3f84ccc5495
comparison
equal deleted inserted replaced
17158:60338880d265 17159:36a3016811d1
41 2 files, 11 changesets, 11 total revisions 41 2 files, 11 changesets, 11 total revisions
42 42
43 Invalid dest '' must abort: 43 Invalid dest '' must abort:
44 44
45 $ hg clone . '' 45 $ hg clone . ''
46 abort: * (glob) 46 abort: empty destination path is not valid
47 [255] 47 [255]
48 48
49 No update, with debug option: 49 No update, with debug option:
50 50
51 #if hardlink 51 #if hardlink
110 2 files, 11 changesets, 11 total revisions 110 2 files, 11 changesets, 11 total revisions
111 111
112 Invalid dest '' with --pull must abort (issue2528): 112 Invalid dest '' with --pull must abort (issue2528):
113 113
114 $ hg clone --pull a '' 114 $ hg clone --pull a ''
115 abort: * (glob) 115 abort: empty destination path is not valid
116 [255] 116 [255]
117 117
118 Clone to '.': 118 Clone to '.':
119 119
120 $ mkdir h 120 $ mkdir h