mercurial/commands.py
changeset 2857 c9b08cacf983
parent 2854 cdbca3d59518
parent 2842 7706fa503677
child 2858 345bac2bc4ec
equal deleted inserted replaced
2856:18cf5349a361 2857:c9b08cacf983
  1820     # (this heuristic is borrowed from quilt)
  1820     # (this heuristic is borrowed from quilt)
  1821     diffre = re.compile(r'^(?:Index:[ \t]|diff[ \t]|RCS file: |' +
  1821     diffre = re.compile(r'^(?:Index:[ \t]|diff[ \t]|RCS file: |' +
  1822                         'retrieving revision [0-9]+(\.[0-9]+)*$|' +
  1822                         'retrieving revision [0-9]+(\.[0-9]+)*$|' +
  1823                         '(---|\*\*\*)[ \t])', re.MULTILINE)
  1823                         '(---|\*\*\*)[ \t])', re.MULTILINE)
  1824 
  1824 
       
  1825     wlock = repo.wlock()
       
  1826     lock = repo.lock()
       
  1827 
  1825     for patch in patches:
  1828     for patch in patches:
  1826         pf = os.path.join(d, patch)
  1829         pf = os.path.join(d, patch)
  1827 
  1830 
  1828         message = None
  1831         message = None
  1829         user = None
  1832         user = None
  1908             if len(files) > 0:
  1911             if len(files) > 0:
  1909                 cfiles = files
  1912                 cfiles = files
  1910                 cwd = repo.getcwd()
  1913                 cwd = repo.getcwd()
  1911                 if cwd:
  1914                 if cwd:
  1912                     cfiles = [util.pathto(cwd, f) for f in files]
  1915                     cfiles = [util.pathto(cwd, f) for f in files]
  1913                 addremove_lock(ui, repo, cfiles, {})
  1916                 addremove_lock(ui, repo, cfiles, {}, wlock=wlock)
  1914             repo.commit(files, message, user, date)
  1917             repo.commit(files, message, user, date, wlock=wlock, lock=lock)
  1915         finally:
  1918         finally:
  1916             os.unlink(tmpname)
  1919             os.unlink(tmpname)
  1917 
  1920 
  1918 def incoming(ui, repo, source="default", **opts):
  1921 def incoming(ui, repo, source="default", **opts):
  1919     """show new changesets found in source
  1922     """show new changesets found in source