[rietveld] push by jrobbins@google.com - Don't fail if mercurial repository has no parent.... on 2014-09-21 20:37 GMT

1 view
Skip to first unread message

riet...@googlecode.com

unread,
Sep 21, 2014, 4:38:15 PM9/21/14
to coderev...@googlegroups.com
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"
Reply all
Reply to author
Forward
0 new messages