Show More
@@ -172,7 +172,7 b' def shrink(ui, repo, **opts):' | |||
|
172 | 172 | raise util.Abort(_('--revlog option must specify the revlog index ' |
|
173 | 173 | 'file (*.i), not %s') % opts.get('revlog')) |
|
174 | 174 | |
|
175 |
indexfn = |
|
|
175 | indexfn = util.realpath(fn) | |
|
176 | 176 | store = repo.sjoin('') |
|
177 | 177 | if not indexfn.startswith(store): |
|
178 | 178 | raise util.Abort(_('--revlog option must specify a revlog in %s, ' |
@@ -45,7 +45,7 b' class darcs_source(converter_source, com' | |||
|
45 | 45 | if ElementTree is None: |
|
46 | 46 | raise util.Abort(_("Python ElementTree module is not available")) |
|
47 | 47 | |
|
48 |
self.path = |
|
|
48 | self.path = util.realpath(path) | |
|
49 | 49 | |
|
50 | 50 | self.lastrev = None |
|
51 | 51 | self.changes = {} |
@@ -46,7 +46,7 b' class gnuarch_source(converter_source, c' | |||
|
46 | 46 | |
|
47 | 47 | commandline.__init__(self, ui, self.execmd) |
|
48 | 48 | |
|
49 |
self.path = |
|
|
49 | self.path = util.realpath(path) | |
|
50 | 50 | self.tmppath = None |
|
51 | 51 | |
|
52 | 52 | self.treeversion = None |
@@ -976,7 +976,7 b' class svn_sink(converter_sink, commandli' | |||
|
976 | 976 | self.wc = None |
|
977 | 977 | self.cwd = os.getcwd() |
|
978 | 978 | |
|
979 |
path = |
|
|
979 | path = util.realpath(path) | |
|
980 | 980 | |
|
981 | 981 | created = False |
|
982 | 982 | if os.path.isfile(os.path.join(path, '.svn', 'entries')): |
@@ -344,7 +344,7 b' def archive(ui, repo, dest, **opts):' | |||
|
344 | 344 | raise util.Abort(_('no working directory: please specify a revision')) |
|
345 | 345 | node = ctx.node() |
|
346 | 346 | dest = cmdutil.makefilename(repo, dest, node) |
|
347 |
if |
|
|
347 | if util.realpath(dest) == repo.root: | |
|
348 | 348 | raise util.Abort(_('repository root cannot be destination')) |
|
349 | 349 | |
|
350 | 350 | kind = opts.get('type') or archival.guesskind(dest) or 'files' |
@@ -130,7 +130,7 b' def share(ui, source, dest=None, update=' | |||
|
130 | 130 | |
|
131 | 131 | sharedpath = srcrepo.sharedpath # if our source is already sharing |
|
132 | 132 | |
|
133 |
root = |
|
|
133 | root = util.realpath(dest) | |
|
134 | 134 | roothg = os.path.join(root, '.hg') |
|
135 | 135 | |
|
136 | 136 | if os.path.exists(roothg): |
@@ -301,7 +301,7 b' def clone(ui, peeropts, source, dest=Non' | |||
|
301 | 301 | |
|
302 | 302 | if copy: |
|
303 | 303 | srcrepo.hook('preoutgoing', throw=True, source='clone') |
|
304 |
hgdir = |
|
|
304 | hgdir = util.realpath(os.path.join(dest, ".hg")) | |
|
305 | 305 | if not os.path.exists(dest): |
|
306 | 306 | os.mkdir(dest) |
|
307 | 307 | else: |
@@ -28,7 +28,7 b' class localrepository(repo.repository):' | |||
|
28 | 28 | |
|
29 | 29 | def __init__(self, baseui, path=None, create=False): |
|
30 | 30 | repo.repository.__init__(self) |
|
31 |
self.root = |
|
|
31 | self.root = util.realpath(util.expandpath(path)) | |
|
32 | 32 | self.path = os.path.join(self.root, ".hg") |
|
33 | 33 | self.origroot = path |
|
34 | 34 | self.auditor = scmutil.pathauditor(self.root, self._checknested) |
@@ -79,7 +79,7 b' class localrepository(repo.repository):' | |||
|
79 | 79 | |
|
80 | 80 | self.sharedpath = self.path |
|
81 | 81 | try: |
|
82 |
s = |
|
|
82 | s = util.realpath(self.opener.read("sharedpath").rstrip('\n')) | |
|
83 | 83 | if not os.path.exists(s): |
|
84 | 84 | raise error.RepoError( |
|
85 | 85 | _('.hg/sharedpath points to nonexistent directory %s') % s) |
@@ -430,7 +430,7 b' def simplemerge(ui, local, base, other, ' | |||
|
430 | 430 | except util.Abort: |
|
431 | 431 | return 1 |
|
432 | 432 | |
|
433 |
local = |
|
|
433 | local = util.realpath(local) | |
|
434 | 434 | if not opts.get('print'): |
|
435 | 435 | opener = scmutil.opener(os.path.dirname(local)) |
|
436 | 436 | out = opener(os.path.basename(local), "w", atomictemp=True) |
@@ -1,11 +1,11 b'' | |||
|
1 | 1 | import os |
|
2 | from mercurial import hg, ui | |
|
2 | from mercurial import hg, ui, util | |
|
3 | 3 | from mercurial.hgweb.hgwebdir_mod import hgwebdir |
|
4 | 4 | |
|
5 | 5 | os.mkdir('webdir') |
|
6 | 6 | os.chdir('webdir') |
|
7 | 7 | |
|
8 |
webdir = |
|
|
8 | webdir = util.realpath('.') | |
|
9 | 9 | |
|
10 | 10 | u = ui.ui() |
|
11 | 11 | hg.repository(u, 'a', create=1) |
General Comments 0
You need to be logged in to leave comments.
Login now