log common directory path of all files in the changeset

Summary: Begin logging the common directory path for the commit's updated files.

Reviewed By: DurhamG

Differential Revision: D19399717

fbshipit-source-id: d47994f573eac6e7cd1596b0b102cb9577e1eea1
This commit is contained in:
Josh Rosenbaum 2020-01-15 19:04:28 -08:00 committed by Facebook Github Bot
parent 3f86263190
commit 6bf2ce6f9b

View File

@ -2372,7 +2372,12 @@ class localrepository(object):
mutation.recordentries(self, [entry], skipexisting=False) mutation.recordentries(self, [entry], skipexisting=False)
tr.close() tr.close()
# Generate and log interesting data.
loginfo = ctx.loginfo() loginfo = ctx.loginfo()
path = os.path.commonprefix([os.path.dirname(p) for p in files])
if len(path) > 0:
loginfo.update({"common_directory_path": path})
diffnumber = diffprops.parserevfromcommitmsg(ctx.description()) diffnumber = diffprops.parserevfromcommitmsg(ctx.description())
if diffnumber is not None: if diffnumber is not None:
loginfo.update({"phabricator_diff_number": diffnumber}) loginfo.update({"phabricator_diff_number": diffnumber})