comparison hgext/mq.py @ 12539:dece1f46f7a2

mq: removed return from callers to patchheader.qseries Some callers to patchheader.qseries returned the value further, but pathcheader.qseries does not explicitly return anything. It was confusing this was returned further
author Erik Zielke <ez@aragost.com>
date Thu, 23 Sep 2010 15:18:10 +0200
parents c87216e5e43e
children 903828be7397
comparison
equal deleted inserted replaced
12538:c87216e5e43e 12539:dece1f46f7a2
1776 start = end - 2 1776 start = end - 2
1777 end = 1 1777 end = 1
1778 else: 1778 else:
1779 start = 0 1779 start = 0
1780 1780
1781 return q.qseries(repo, length=end, start=start, status='A', 1781 q.qseries(repo, length=end, start=start, status='A',
1782 summary=opts.get('summary')) 1782 summary=opts.get('summary'))
1783
1783 1784
1784 def unapplied(ui, repo, patch=None, **opts): 1785 def unapplied(ui, repo, patch=None, **opts):
1785 """print the patches not yet applied 1786 """print the patches not yet applied
1786 1787
1787 Returns 0 on success.""" 1788 Returns 0 on success."""
1797 if start == len(q.series) and opts.get('first'): 1798 if start == len(q.series) and opts.get('first'):
1798 ui.write(_("all patches applied\n")) 1799 ui.write(_("all patches applied\n"))
1799 return 1 1800 return 1
1800 1801
1801 length = opts.get('first') and 1 or None 1802 length = opts.get('first') and 1 or None
1802 return q.qseries(repo, start=start, length=length, status='U', 1803 q.qseries(repo, start=start, length=length, status='U',
1803 summary=opts.get('summary')) 1804 summary=opts.get('summary'))
1804 1805
1805 def qimport(ui, repo, *filename, **opts): 1806 def qimport(ui, repo, *filename, **opts):
1806 """import a patch 1807 """import a patch
1807 1808
1808 The patch is inserted into the series after the last applied 1809 The patch is inserted into the series after the last applied
1974 1975
1975 Returns 0 on success.""" 1976 Returns 0 on success."""
1976 q = repo.mq 1977 q = repo.mq
1977 t = q.applied and q.series_end(True) or 0 1978 t = q.applied and q.series_end(True) or 0
1978 if t: 1979 if t:
1979 return q.qseries(repo, start=t - 1, length=1, status='A', 1980 q.qseries(repo, start=t - 1, length=1, status='A',
1980 summary=opts.get('summary')) 1981 summary=opts.get('summary'))
1981 else: 1982 else:
1982 ui.write(_("no patches applied\n")) 1983 ui.write(_("no patches applied\n"))
1983 return 1 1984 return 1
1984 1985
1985 def next(ui, repo, **opts): 1986 def next(ui, repo, **opts):
1989 q = repo.mq 1990 q = repo.mq
1990 end = q.series_end() 1991 end = q.series_end()
1991 if end == len(q.series): 1992 if end == len(q.series):
1992 ui.write(_("all patches applied\n")) 1993 ui.write(_("all patches applied\n"))
1993 return 1 1994 return 1
1994 return q.qseries(repo, start=end, length=1, summary=opts.get('summary')) 1995 q.qseries(repo, start=end, length=1, summary=opts.get('summary'))
1995 1996
1996 def prev(ui, repo, **opts): 1997 def prev(ui, repo, **opts):
1997 """print the name of the previous patch 1998 """print the name of the previous patch
1998 1999
1999 Returns 0 on success.""" 2000 Returns 0 on success."""
2003 ui.write(_("only one patch applied\n")) 2004 ui.write(_("only one patch applied\n"))
2004 return 1 2005 return 1
2005 if not l: 2006 if not l:
2006 ui.write(_("no patches applied\n")) 2007 ui.write(_("no patches applied\n"))
2007 return 1 2008 return 1
2008 return q.qseries(repo, start=l - 2, length=1, status='A', 2009 q.qseries(repo, start=l - 2, length=1, status='A',
2009 summary=opts.get('summary')) 2010 summary=opts.get('summary'))
2010 2011
2011 def setupheaderopts(ui, opts): 2012 def setupheaderopts(ui, opts):
2012 if not opts.get('user') and opts.get('currentuser'): 2013 if not opts.get('user') and opts.get('currentuser'):
2013 opts['user'] = ui.username() 2014 opts['user'] = ui.username()
2014 if not opts.get('date') and opts.get('currentdate'): 2015 if not opts.get('date') and opts.get('currentdate'):