3936: The file %s (revision %s) was not found in the repository

david.nova**********@gmai***** (Google Code) (Is this you? Claim this profile.)
What version are you running?
rbcommons

What's the URL of the page containing the problem?
https://rbcommons.com/s/twitter/r/2572/

What steps will reproduce the problem?
1. Try to upload the attached diff

What is the expected output? What do you see instead?

I want the diff to be uploaded, but I get the following message: The file "src/python/pants/base/build_file.py" (revision 1da8188) was not found in the repository

But that is, afaict, the revision of that file on master.

What operating system are you using? What browser?

Ubuntu, Chromium.

Please provide any additional information below.

See the comment thread at the bottom of https://rbcommons.com/s/twitter/r/2572/ (on John Sirois's Ship it, Aug. 5, 2015, 5:50 p.m.) for the complete history.
diff --git a/src/python/pants/base/build_file.py b/src/python/pants/base/build_file.py
index 1da8188..59cccf8 100644
--- a/src/python/pants/base/build_file.py
+++ b/src/python/pants/base/build_file.py
@@ -38,6 +38,10 @@ class BuildFile(AbstractClass):
     """Raised when the root_dir specified to a BUILD file is not valid."""
     pass
 
+  class BadPathError(BuildFileError):
+    """Raised when scan_buildfiles is called on a nonexistent directory."""
+    pass
+
   _BUILD_FILE_PREFIX = 'BUILD'
   _PATTERN = re.compile('^{prefix}(\.[a-zA-Z0-9_-]+)?$'.format(prefix=_BUILD_FILE_PREFIX))
 
@@ -104,6 +108,10 @@ class BuildFile(AbstractClass):
               to_remove.append(subdir)
       return to_remove
 
+    if base_path and not cls._isdir(os.path.join(root_dir, base_path)):
+      raise cls.BadPathError('Can only scan directories and {0} is not a valid dir'
+                              .format(base_path))
+
     buildfiles = []
     if not spec_excludes:
       exclude_roots = {}
@@
chipx86
#1 chipx86
How was the diff generated?

In order to look up files on a remote repository, a full SHA1 must be provided in the diff. RBTools will ensure a full SHA1 is used, but if you're generating a diff manually, you'll need to pass --full-index to git diff.
  • +NeedInfo
david
#2 david
  • -NeedInfo
    +Incomplete