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