hgext/mq.py
changeset 5226 438ff951df70
parent 5180 5bbbd1f1d586
child 5248 5517aa5aafb0
child 5334 448eb46d4d84
equal deleted inserted replaced
5225:76c4cadb49fc 5226:438ff951df70
  1488     before that it has no patches applied.
  1488     before that it has no patches applied.
  1489 
  1489 
  1490     Source patch repository is looked for in <src>/.hg/patches by
  1490     Source patch repository is looked for in <src>/.hg/patches by
  1491     default.  Use -p <url> to change.
  1491     default.  Use -p <url> to change.
  1492     '''
  1492     '''
       
  1493     def patchdir(repo):
       
  1494         url = repo.url()
       
  1495         if url.endswith('/'):
       
  1496             url = url[:-1]
       
  1497         return url + '/.hg/patches'
  1493     cmdutil.setremoteconfig(ui, opts)
  1498     cmdutil.setremoteconfig(ui, opts)
  1494     if dest is None:
  1499     if dest is None:
  1495         dest = hg.defaultdest(source)
  1500         dest = hg.defaultdest(source)
  1496     sr = hg.repository(ui, ui.expandpath(source))
  1501     sr = hg.repository(ui, ui.expandpath(source))
  1497     qbase, destrev = None, None
  1502     qbase, destrev = None, None
  1509                       pull=opts['pull'],
  1514                       pull=opts['pull'],
  1510                       rev=destrev,
  1515                       rev=destrev,
  1511                       update=False,
  1516                       update=False,
  1512                       stream=opts['uncompressed'])
  1517                       stream=opts['uncompressed'])
  1513     ui.note(_('cloning patch repo\n'))
  1518     ui.note(_('cloning patch repo\n'))
  1514     spr, dpr = hg.clone(ui, opts['patches'] or (sr.url() + '/.hg/patches'),
  1519     spr, dpr = hg.clone(ui, opts['patches'] or patchdir(sr), patchdir(dr),
  1515                         dr.url() + '/.hg/patches',
  1520                         pull=opts['pull'], update=not opts['noupdate'],
  1516                         pull=opts['pull'],
       
  1517                         update=not opts['noupdate'],
       
  1518                         stream=opts['uncompressed'])
  1521                         stream=opts['uncompressed'])
  1519     if dr.local():
  1522     if dr.local():
  1520         if qbase:
  1523         if qbase:
  1521             ui.note(_('stripping applied patches from destination repo\n'))
  1524             ui.note(_('stripping applied patches from destination repo\n'))
  1522             dr.mq.strip(dr, qbase, update=False, backup=None)
  1525             dr.mq.strip(dr, qbase, update=False, backup=None)