2832 if options['debugger']: |
2832 if options['debugger']: |
2833 pdb.set_trace() |
2833 pdb.set_trace() |
2834 |
2834 |
2835 try: |
2835 try: |
2836 try: |
2836 try: |
2837 path = options["repository"] |
2837 if options['cwd']: |
2838 if path: |
2838 try: |
2839 repo = hg.repository(u, path=path) |
2839 os.chdir(options['cwd']) |
2840 else: |
2840 except OSError, inst: |
2841 repo = None |
2841 raise util.Abort('%s: %s' % |
2842 path = "" |
2842 (options['cwd'], inst.strerror)) |
|
2843 |
|
2844 path = options["repository"] or "" |
|
2845 repo = path and hg.repository(u, path=path) or None |
2843 |
2846 |
2844 if options['help']: |
2847 if options['help']: |
2845 help_(u, cmd, options['version']) |
2848 help_(u, cmd, options['version']) |
2846 sys.exit(0) |
2849 sys.exit(0) |
2847 elif options['version']: |
2850 elif options['version']: |
2848 show_version(u) |
2851 show_version(u) |
2849 sys.exit(0) |
2852 sys.exit(0) |
2850 elif not cmd: |
2853 elif not cmd: |
2851 help_(u, 'shortlist') |
2854 help_(u, 'shortlist') |
2852 sys.exit(0) |
2855 sys.exit(0) |
2853 |
|
2854 if options['cwd']: |
|
2855 try: |
|
2856 os.chdir(options['cwd']) |
|
2857 except OSError, inst: |
|
2858 raise util.Abort('%s: %s' % |
|
2859 (options['cwd'], inst.strerror)) |
|
2860 |
2856 |
2861 if cmd not in norepo.split(): |
2857 if cmd not in norepo.split(): |
2862 try: |
2858 try: |
2863 if not repo: |
2859 if not repo: |
2864 repo = hg.repository(u, path=path) |
2860 repo = hg.repository(u, path=path) |