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

hgtk: make push mode detection more robust

Previous code was broken.

Changeset 381a6b5bb814

Parent 2371851d6e5e

by Steve Borho

Changes to one file · Browse files at 381a6b5bb814 Showing diff from parent 2371851d6e5e Diff from another changeset...

Change 1 of 4 Show Entire File hggtk/​hgtk.py Stacked
 
124
125
126
127
128
 
 
 
 
 
 
129
130
131
 
132
133
134
 
152
153
154
155
 
156
157
158
 
185
186
187
188
 
 
189
190
191
 
392
393
394
395
396
 
 
397
398
399
 
124
125
126
 
 
127
128
129
130
131
132
133
134
135
136
137
138
139
 
157
158
159
 
160
161
162
163
 
190
191
192
 
193
194
195
196
197
 
398
399
400
 
 
401
402
403
404
405
@@ -124,11 +124,16 @@
  raise hglib.ParseError(None, inst)     if args: - cmd, args = args[0], args[1:] - aliases, i = cmdutil.findcmd(cmd, table, ui.config("ui", "strict")) + alias, args = args[0], args[1:] + aliases, i = cmdutil.findcmd(alias, table, ui.config("ui", "strict")) + for a in aliases: + if a.startswith(alias): + alias = a + break   cmd = aliases[0]   c = list(i[1])   else: + alias = None   cmd = None   c = []   @@ -152,7 +157,7 @@
  del options['listfile']   args += get_list_from_file(listfile)   - return (cmd, cmd and i[0] or None, args, options, cmdoptions) + return (cmd, cmd and i[0] or None, args, options, cmdoptions, alias)    def _runcatch(ui, args):   try: @@ -185,7 +190,8 @@
   def runcommand(ui, args):   fullargs = args - cmd, func, args, options, cmdoptions = _parse(ui, args) + cmd, func, args, options, cmdoptions, alias = _parse(ui, args) + cmdoptions['alias'] = alias   ui.setconfig("ui", "verbose", str(bool(options["verbose"])))     if options['help']: @@ -392,8 +398,8 @@
  """repository synchronization tool"""   portable_fork()   from hggtk.synch import run - cmd = sys.argv[1] - if 'push'.startswith(cmd) or 'outgoing'.startswith(cmd): + cmd = opts['alias'] + if cmd in ('push', 'outgoing', 'email'):   opts['pushmode'] = True   else:   opts['pushmode'] = False