##// END OF EJS Templates
dispatch: give better error message when cwd doesn't exist (issue2293)...
Mads Kiilerich -
r11675:f92f8921 stable
parent child Browse files
Show More
@@ -366,7 +366,12 b' def _dispatch(ui, args):'
366 os.chdir(cwd[-1])
366 os.chdir(cwd[-1])
367
367
368 # read the local repository .hgrc into a local ui object
368 # read the local repository .hgrc into a local ui object
369 path = cmdutil.findrepo(os.getcwd()) or ""
369 try:
370 wd = os.getcwd()
371 except OSError, e:
372 raise util.Abort(_("error getting current working directory: %s") %
373 e.strerror)
374 path = cmdutil.findrepo(wd) or ""
370 if not path:
375 if not path:
371 lui = ui
376 lui = ui
372 else:
377 else:
@@ -3,6 +3,8 b''
3
3
4 "$TESTDIR/hghave" no-outer-repo || exit 80
4 "$TESTDIR/hghave" no-outer-repo || exit 80
5
5
6 dir=`pwd`
7
6 hg init a
8 hg init a
7 cd a
9 cd a
8 echo a > a
10 echo a > a
@@ -19,8 +21,12 b' cat = -r null'
19 EOF
21 EOF
20 hg cat a
22 hg cat a
21
23
24 echo '% working directory removed'
25 rm -rf $dir/a
26 hg --version
27
22 echo '% no repo'
28 echo '% no repo'
23 cd ..
29 cd $dir
24 hg cat
30 hg cat
25
31
26 exit 0
32 exit 0
@@ -33,5 +33,7 b' use "hg -v help cat" to show global opti'
33 % [defaults]
33 % [defaults]
34 a
34 a
35 a: No such file in rev 000000000000
35 a: No such file in rev 000000000000
36 % working directory removed
37 abort: error getting current working directory: No such file or directory
36 % no repo
38 % no repo
37 abort: There is no Mercurial repository here (.hg not found)!
39 abort: There is no Mercurial repository here (.hg not found)!
General Comments 0
You need to be logged in to leave comments. Login now