# HG changeset patch # User Thomas Arendsen Hein # Date 1125038863 -7200 # Node ID 9c09094de48ce1b9acde332c88615b3f795c6534 # Parent 160a68cd393f3ade8ba28f11a5bcf5a30a8fc391 Moved --cwd handling to a place where ui and exception handling already exists. diff -r 160a68cd393f -r 9c09094de48c mercurial/commands.py --- 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)