git-p4: improve client path detection when branches are used
commitcd88410618d9068f17ba5de0f9959e4ec4f42789
authorVitor Antunes <vitor.hda@gmail.com>
Tue, 21 Apr 2015 22:49:30 +0000 (21 23:49 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Apr 2015 17:17:02 +0000 (23 10:17 -0700)
treea6974736840d0bc1adcffbf37e5ab51a305f5cce
parent591707a736bd5cdded81a86e50e5ca46604d8a38
git-p4: improve client path detection when branches are used

Perforce allows client side file/directory remapping through
the use of the client view definition that is part of the
user's client spec.

To support this functionality while branch detection is
enabled it is important to determine the branch location in
the workspace such that the correct files are patched before
Perforce submission. Perforce provides a command that
facilitates this process: p4 where.

This patch does two things to fix improve file location
detection when git-p4 has branch detection and use of client
spec enabled:

 1. Enable usage of "p4 where" when Perforce branches exist
    in the git repository, even when client specification is
    used. This makes use of the already existing function
    p4Where.

 2. Allow identifying partial matches of the branch's depot
    path while processing the output of "p4 where". For
    robustness, paths will only match if ending in "/...".

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py
t/t9801-git-p4-branch.sh