Moved --cwd handling to a place where ui and exception handling already exists.
--- a/mercurial/commands.py Fri Aug 26 08:42:56 2005 +0200
+++ b/mercurial/commands.py Fri Aug 26 08:47:43 2005 +0200
@@ -1609,14 +1609,6 @@
help_(u, 'shortlist')
sys.exit(1)
- if options['cwd']:
- try:
- os.chdir(options['cwd'])
- except OSError, inst:
- u = ui.ui()
- u.warn('abort: %s: %s\n' % (options['cwd'], inst.strerror))
- sys.exit(1)
-
if options["time"]:
def get_times():
t = os.times()
@@ -1646,6 +1638,13 @@
help_(u, 'shortlist')
sys.exit(0)
+ if options['cwd']:
+ try:
+ os.chdir(options['cwd'])
+ except OSError, inst:
+ u.warn('abort: %s: %s\n' % (options['cwd'], inst.strerror))
+ sys.exit(1)
+
if cmd not in norepo.split():
path = options["repository"] or ""
repo = hg.repository(ui=u, path=path)