comparison hgext/mq.py @ 15934:9d4b5c3cb853

qimport: back out 2eec74d7ce95 This patch presumed mq csets must always be secret, which isn't yet established.
author Matt Mackall <mpm@selenic.com>
date Thu, 19 Jan 2012 11:35:06 -0600
parents 44b5de2d1876
children ec8a9e06cf05
comparison
equal deleted inserted replaced
15933:b8696a6676be 15934:9d4b5c3cb853
1812 se = statusentry(n, patchname) 1812 se = statusentry(n, patchname)
1813 self.applied.insert(0, se) 1813 self.applied.insert(0, se)
1814 1814
1815 self.added.append(patchname) 1815 self.added.append(patchname)
1816 patchname = None 1816 patchname = None
1817 if rev:
1818 # if we added anything with rev, we must move the secret root
1819 phases.retractboundary(repo, phases.secret, [n])
1820 self.parseseries() 1817 self.parseseries()
1821 self.applieddirty = True 1818 self.applieddirty = True
1822 self.seriesdirty = True 1819 self.seriesdirty = True
1823 1820
1824 for i, filename in enumerate(files): 1821 for i, filename in enumerate(files):
1989 1986
1990 hg qimport -e existing-patch -n new-name 1987 hg qimport -e existing-patch -n new-name
1991 1988
1992 Returns 0 if import succeeded. 1989 Returns 0 if import succeeded.
1993 """ 1990 """
1994 lock = repo.lock() # cause this may move phase 1991 q = repo.mq
1995 try: 1992 try:
1996 q = repo.mq 1993 q.qimport(repo, filename, patchname=opts.get('name'),
1997 try: 1994 existing=opts.get('existing'), force=opts.get('force'),
1998 q.qimport(repo, filename, patchname=opts.get('name'), 1995 rev=opts.get('rev'), git=opts.get('git'))
1999 existing=opts.get('existing'), force=opts.get('force'),
2000 rev=opts.get('rev'), git=opts.get('git'))
2001 finally:
2002 q.savedirty()
2003
2004
2005 if opts.get('push') and not opts.get('rev'):
2006 return q.push(repo, None)
2007 finally: 1996 finally:
2008 lock.release() 1997 q.savedirty()
1998
1999 if opts.get('push') and not opts.get('rev'):
2000 return q.push(repo, None)
2009 return 0 2001 return 0
2010 2002
2011 def qinit(ui, repo, create): 2003 def qinit(ui, repo, create):
2012 """initialize a new queue repository 2004 """initialize a new queue repository
2013 2005