Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

hgtk: fix warnings for commands that require repositories

if no repository was found, path was None, and that breaks hg.

Changeset 4d0324775993

Parent 3b85bf9f207f

by Steve Borho

Changes to one file · Browse files at 4d0324775993 Showing diff from parent 3b85bf9f207f Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​hgtk.py Stacked
 
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
 
 
 
203
204
205
 
186
187
188
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
190
191
192
193
194
@@ -186,20 +186,9 @@
  extsetup()   _loaded[name] = 1   - if cmd not in nonrepo_commands.split(): - try: - repo = hg.repository(ui, path=path) - except hglib.RepoError, inst: - # try to guess the repo from first of file args - root = None - if args: - path = paths.find_root(args[0]) - if path: - repo = hg.repository(ui, path=path) - else: - raise hglib.RepoError(_("There is no Mercurial repository here" - " (.hg not found)")) - cmdoptions['root'] = os.path.abspath(path) + if cmd not in nonrepo_commands.split() and not path: + raise hglib.RepoError(_("There is no Mercurial repository here" + " (.hg not found)"))     try:   return func(ui, *args, **cmdoptions)