mercurial/commands.py
changeset 5203 ce4e67533723
parent 5190 da1658d63647
child 5224 9cd6578750b9
equal deleted inserted replaced
5202:6f636d13f6b8 5203:ce4e67533723
  1565             if pf == '-':
  1565             if pf == '-':
  1566                 ui.status(_("applying patch from stdin\n"))
  1566                 ui.status(_("applying patch from stdin\n"))
  1567                 data = patch.extract(ui, sys.stdin)
  1567                 data = patch.extract(ui, sys.stdin)
  1568             else:
  1568             else:
  1569                 ui.status(_("applying %s\n") % p)
  1569                 ui.status(_("applying %s\n") % p)
  1570                 data = patch.extract(ui, file(pf, 'rb'))
  1570                 if os.path.exists(pf):
  1571 
  1571                     data = patch.extract(ui, file(pf, 'rb'))
       
  1572                 else:
       
  1573                     data = patch.extract(ui, urllib.urlopen(pf))
  1572             tmpname, message, user, date, branch, nodeid, p1, p2 = data
  1574             tmpname, message, user, date, branch, nodeid, p1, p2 = data
  1573 
  1575 
  1574             if tmpname is None:
  1576             if tmpname is None:
  1575                 raise util.Abort(_('no diffs found'))
  1577                 raise util.Abort(_('no diffs found'))
  1576 
  1578