changeset 1050:9c09094de48c

Moved --cwd handling to a place where ui and exception handling already exists.
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 26 Aug 2005 08:47:43 +0200
parents 160a68cd393f
children 3c918b7ad8da
files mercurial/commands.py
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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)