##// END OF EJS Templates
mq: add --git option to qimport -r
Brendan Cully -
r3691:79151c94 default
parent child Browse files
Show More
@@ -1262,7 +1262,7 b' class queue:'
1262 1262 return p
1263 1263
1264 1264 def qimport(self, repo, files, patchname=None, rev=None, existing=None,
1265 force=None):
1265 force=None, git=False):
1266 1266 def checkseries(patchname):
1267 1267 if patchname in self.series:
1268 1268 raise util.Abort(_('patch %s is already in the series file')
@@ -1307,6 +1307,9 b' class queue:'
1307 1307 % rev[0])
1308 1308 lastparent = None
1309 1309
1310 if git:
1311 self.diffopts().git = True
1312
1310 1313 for r in rev:
1311 1314 p1, p2 = repo.changelog.parentrevs(r)
1312 1315 n = repo.changelog.node(r)
@@ -1424,10 +1427,13 b' def qimport(ui, repo, *filename, **opts)'
1424 1427
1425 1428 An existing changeset may be placed under mq control with --rev
1426 1429 (e.g. qimport --rev tip -n patch will place tip under mq control).
1430 With --git, patches imported with --rev will use the git diff
1431 format.
1427 1432 """
1428 1433 q = repo.mq
1429 1434 q.qimport(repo, filename, patchname=opts['name'],
1430 existing=opts['existing'], force=opts['force'], rev=opts['rev'])
1435 existing=opts['existing'], force=opts['force'], rev=opts['rev'],
1436 git=opts['git'])
1431 1437 q.save_dirty()
1432 1438 return 0
1433 1439
@@ -2090,8 +2096,9 b' cmdtable = {'
2090 2096 [('e', 'existing', None, 'import file in patch dir'),
2091 2097 ('n', 'name', '', 'patch file name'),
2092 2098 ('f', 'force', None, 'overwrite existing files'),
2093 ('r', 'rev', [], 'place existing revisions under mq control')],
2094 'hg qimport [-e] [-n NAME] [-f] [-r REV]... FILE...'),
2099 ('r', 'rev', [], 'place existing revisions under mq control'),
2100 ('g', 'git', None, _('use git extended diff format'))],
2101 'hg qimport [-e] [-n NAME] [-f] [-g] [-r REV]... FILE...'),
2095 2102 "^qinit":
2096 2103 (init,
2097 2104 [('c', 'create-repo', None, 'create queue repository')],
General Comments 0
You need to be logged in to leave comments. Login now