comparison hgext/mq.py @ 16683:525fdb738975

cleanup: eradicate long lines
author Brodie Rao <brodie@sf.io>
date Sat, 12 May 2012 15:54:54 +0200
parents b6081c2c4647
children e34106fa0dc3
comparison
equal deleted inserted replaced
16676:654b9e1966f7 16683:525fdb738975
1244 if exact: 1244 if exact:
1245 if check: 1245 if check:
1246 raise util.Abort( 1246 raise util.Abort(
1247 _("cannot use --exact and --check together")) 1247 _("cannot use --exact and --check together"))
1248 if move: 1248 if move:
1249 raise util.Abort(_("cannot use --exact and --move together")) 1249 raise util.Abort(_('cannot use --exact and --move '
1250 'together'))
1250 if self.applied: 1251 if self.applied:
1251 raise util.Abort(_("cannot push --exact with applied patches")) 1252 raise util.Abort(_('cannot push --exact with applied '
1253 'patches'))
1252 root = self.series[start] 1254 root = self.series[start]
1253 target = patchheader(self.join(root), self.plainmode).parent 1255 target = patchheader(self.join(root), self.plainmode).parent
1254 if not target: 1256 if not target:
1255 raise util.Abort( 1257 raise util.Abort(
1256 _("%s does not have a parent recorded") % root) 1258 _("%s does not have a parent recorded") % root)
2185 commands. With -c, use :hg:`init --mq` instead.""" 2187 commands. With -c, use :hg:`init --mq` instead."""
2186 return qinit(ui, repo, create=opts.get('create_repo')) 2188 return qinit(ui, repo, create=opts.get('create_repo'))
2187 2189
2188 @command("qclone", 2190 @command("qclone",
2189 [('', 'pull', None, _('use pull protocol to copy metadata')), 2191 [('', 'pull', None, _('use pull protocol to copy metadata')),
2190 ('U', 'noupdate', None, _('do not update the new working directories')), 2192 ('U', 'noupdate', None,
2193 _('do not update the new working directories')),
2191 ('', 'uncompressed', None, 2194 ('', 'uncompressed', None,
2192 _('use uncompressed transfer (fast over LAN)')), 2195 _('use uncompressed transfer (fast over LAN)')),
2193 ('p', 'patches', '', 2196 ('p', 'patches', '',
2194 _('location of source patch repository'), _('REPO')), 2197 _('location of source patch repository'), _('REPO')),
2195 ] + commands.remoteopts, 2198 ] + commands.remoteopts,
2287 _('hg qseries [-ms]')) 2290 _('hg qseries [-ms]'))
2288 def series(ui, repo, **opts): 2291 def series(ui, repo, **opts):
2289 """print the entire series file 2292 """print the entire series file
2290 2293
2291 Returns 0 on success.""" 2294 Returns 0 on success."""
2292 repo.mq.qseries(repo, missing=opts.get('missing'), summary=opts.get('summary')) 2295 repo.mq.qseries(repo, missing=opts.get('missing'),
2296 summary=opts.get('summary'))
2293 return 0 2297 return 0
2294 2298
2295 @command("qtop", seriesopts, _('hg qtop [-s]')) 2299 @command("qtop", seriesopts, _('hg qtop [-s]'))
2296 def top(ui, repo, **opts): 2300 def top(ui, repo, **opts):
2297 """print the name of the current patch 2301 """print the name of the current patch
2508 for f in files: 2512 for f in files:
2509 p = q.lookup(f) 2513 p = q.lookup(f)
2510 if p in patches or p == parent: 2514 if p in patches or p == parent:
2511 ui.warn(_('Skipping already folded patch %s\n') % p) 2515 ui.warn(_('Skipping already folded patch %s\n') % p)
2512 if q.isapplied(p): 2516 if q.isapplied(p):
2513 raise util.Abort(_('qfold cannot fold already applied patch %s') % p) 2517 raise util.Abort(_('qfold cannot fold already applied patch %s')
2518 % p)
2514 patches.append(p) 2519 patches.append(p)
2515 2520
2516 for p in patches: 2521 for p in patches:
2517 if not message: 2522 if not message:
2518 ph = patchheader(q.join(p), q.plainmode) 2523 ph = patchheader(q.join(p), q.plainmode)
2616 applied = set(p.name for p in q.applied) 2621 applied = set(p.name for p in q.applied)
2617 patch = None 2622 patch = None
2618 args = list(args) 2623 args = list(args)
2619 if opts.get('list'): 2624 if opts.get('list'):
2620 if args or opts.get('none'): 2625 if args or opts.get('none'):
2621 raise util.Abort(_('cannot mix -l/--list with options or arguments')) 2626 raise util.Abort(_('cannot mix -l/--list with options or '
2627 'arguments'))
2622 for i in xrange(len(q.series)): 2628 for i in xrange(len(q.series)):
2623 status(i) 2629 status(i)
2624 return 2630 return
2625 if not args or args[0][0:1] in '-+': 2631 if not args or args[0][0:1] in '-+':
2626 if not q.applied: 2632 if not q.applied:
2682 return newpath 2688 return newpath
2683 2689
2684 @command("^qpush", 2690 @command("^qpush",
2685 [('c', 'check', None, _('tolerate non-conflicting local changes')), 2691 [('c', 'check', None, _('tolerate non-conflicting local changes')),
2686 ('f', 'force', None, _('apply on top of local changes')), 2692 ('f', 'force', None, _('apply on top of local changes')),
2687 ('e', 'exact', None, _('apply the target patch to its recorded parent')), 2693 ('e', 'exact', None,
2694 _('apply the target patch to its recorded parent')),
2688 ('l', 'list', None, _('list patch name in commit text')), 2695 ('l', 'list', None, _('list patch name in commit text')),
2689 ('a', 'all', None, _('apply all patches')), 2696 ('a', 'all', None, _('apply all patches')),
2690 ('m', 'merge', None, _('merge from another queue (DEPRECATED)')), 2697 ('m', 'merge', None, _('merge from another queue (DEPRECATED)')),
2691 ('n', 'name', '', 2698 ('n', 'name', '',
2692 _('merge queue name (DEPRECATED)'), _('NAME')), 2699 _('merge queue name (DEPRECATED)'), _('NAME')),
3372 mqtags.append((mqtags[0][0], 'qbase')) 3379 mqtags.append((mqtags[0][0], 'qbase'))
3373 mqtags.append((self.changelog.parents(mqtags[0][0])[0], 'qparent')) 3380 mqtags.append((self.changelog.parents(mqtags[0][0])[0], 'qparent'))
3374 tags = result[0] 3381 tags = result[0]
3375 for patch in mqtags: 3382 for patch in mqtags:
3376 if patch[1] in tags: 3383 if patch[1] in tags:
3377 self.ui.warn(_('Tag %s overrides mq patch of the same name\n') 3384 self.ui.warn(_('Tag %s overrides mq patch of the same '
3378 % patch[1]) 3385 'name\n') % patch[1])
3379 else: 3386 else:
3380 tags[patch[1]] = patch[0] 3387 tags[patch[1]] = patch[0]
3381 3388
3382 return result 3389 return result
3383 3390