Revision: 0e224a41bcfd
Branch: default
Author: Jason Robbins <
jrob...@chromium.org>
Date: Sun Sep 21 20:37:30 2014 UTC
Log: Don't fail if mercurial repository has no parent.
On behalf of: ced
Review URL:
https://codereview.appspot.com/101710043/
https://code.google.com/p/rietveld/source/detail?r=0e224a41bcfd
Modified:
/upload.py
=======================================
--- /upload.py Tue Aug 5 18:14:39 2014 UTC
+++ /upload.py Sun Sep 21 20:37:30 2014 UTC
@@ -1774,7 +1774,11 @@
if self.options.revision:
self.base_rev = self.options.revision
else:
- self.base_rev =
RunShell(["hg", "parent", "-q"]).split(':')[1].strip()
+ parent = RunShell(["hg", "parent", "-q"], silent_ok=True)
+ if parent:
+ self.base_rev = parent.split(':')[1].strip()
+ else:
+ self.base_rev = '0'
def GetGUID(self):
# See chapter "Uniquely identifying a repository"