'(?P<binary>Binary) files '.
'(?P<old>.+)\s+\d{4}-\d{2}-\d{2} and '.
'(?P<new>.+)\s+\d{4}-\d{2}-\d{2} differ.*',
-
// This is a normal Mercurial text change, probably from "hg diff". It
// may have two "-r" blocks if it came from "hg diff -r x:y".
'(?P<type>diff -r) (?P<hgrev>[a-f0-9]+) (?:-r [a-f0-9]+ )?(?P<cur>.+)',
// contains some meta information and comment at the beginning
// (isFirstNonEmptyLine() to check for beginning). Actual mercurial
// code detects where comment ends and unified diff starts by
- // searching "diff -r" in the text.
+ // searching for "diff -r" or "diff --git" in the text.
$this->saveLine();
$line = $this->nextLineThatLooksLikeDiffStart();
if (!$this->tryMatchHeader($patterns, $line, $match)) {
protected function nextLineThatLooksLikeDiffStart() {
while (($line = $this->nextLine()) !== null) {
- if (preg_match('/^\s*diff\s+-r/', $line)) {
+ if (preg_match('/^\s*diff\s+-(?:r|-git)/', $line)) {
break;
}
}
case 'hg-patch.hgdiff':
$this->assertEqual(1, count($changes));
break;
+ case 'hg-patch-git.hgdiff':
+ $this->assertEqual(1, count($changes));
+ break;
case 'custom-prefixes.gitdiff':
$this->assertEqual(1, count($changes));
$change = head($changes);
--- /dev/null
+# HG changeset patch
+# Date 1358829820 0
+# Node ID 0c4c74e145f5e842a855330f600dba87b2f80fc9
+# Parent 80034eb49c320ccd43a1635471baf5c359f43cb5
+Added .arcconfig
+
+diff --git a/.arcconfig b/.arcconfig
+new file mode 100644
+--- /dev/null
++++ b/.arcconfig
+@@ -0,0 +1,5 @@
++{
++ "project_id" : "TestProject",
++ "conduit_uri" : "http://phabricator.example.com/",
++ "history.immutable" : true
++}
+