1. 24 4月, 2015 1 次提交
    • V
      git-p4: improve client path detection when branches are used · cd884106
      Vitor Antunes 提交于
      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: NVitor Antunes <vitor.hda@gmail.com>
      Acked-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cd884106
  2. 21 4月, 2015 1 次提交
  3. 05 4月, 2015 1 次提交
  4. 12 2月, 2015 1 次提交
  5. 24 1月, 2015 1 次提交
  6. 14 6月, 2014 1 次提交
  7. 28 5月, 2014 1 次提交
    • M
      git-p4: Do not include diff in spec file when just preparing p4 · b4073bb3
      Maxime Coste 提交于
      The diff information render the spec file unusable as is by p4,
      do not include it when run with --prepare-p4-only so that the
      given file can be directly passed to p4.
      
      With --prepare-p4-only, git-p4 already tells the user it can use
      p4 submit with the generated spec file. This fails because of the
      diff being present in the file. Not including the diff fixes that.
      
      Without --prepare-p4-only, keeping the diff makes sense for a
      quick review of the patch before submitting it. And does not cause
      problems with p4 as we remove it programmatically.
      Signed-off-by: NMaxime Coste <frrrwww@gmail.com>
      Acked-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b4073bb3
  8. 08 5月, 2014 1 次提交
  9. 08 4月, 2014 1 次提交
  10. 23 1月, 2014 4 次提交
    • P
      git p4: fix an error message when "p4 where" fails · 20005443
      Pete Wyckoff 提交于
      When "p4 where" fails, for whatever reason, the error message tries to
      show an undefined variable.  This minor bug applies only when using a
      client spec, and was introduced recently in 9d57c4a6 (git p4: implement
      view spec wildcards with "p4 where", 2013-08-30).
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      20005443
    • P
      git p4: handle files with wildcards when doing RCS scrubbing · 79467e61
      Pete Wyckoff 提交于
      Commit 9d7d446a (git p4: submit files with wildcards, 2012-04-29)
      fixed problems with handling files that had p4 wildcard
      characters, like "@" and "*".  But it missed one case, that of
      RCS keyword scrubbing, which uses "p4 fstat" to extract type
      information.  Fix it by calling wildcard_encode() on the raw
      filename.
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      79467e61
    • P
      git p4 test: do not pollute /tmp · 0cf1b72a
      Pete Wyckoff 提交于
      Generating the submit template for p4 uses tempfile.mkstemp(),
      which by default puts files in /tmp.  For a test that fails,
      possibly on purpose, this is not cleaned up.  Run with TMPDIR
      pointing into the trash directory so the temp files go away
      with the test results.
      
      To do this required some other minor changes.  First, the editor
      is launched using system(editor + " " + template_file), using
      shell expansion to build the command string.  This doesn't work
      if editor has a space in it.  And is generally unwise as it's
      easy to fool the shell into doing extra work.  Exec the args
      directly, without shell expansion.
      
      Second, without shell expansion, the trick of "P4EDITOR=:" used
      in the tests doesn't work.  Use a real command, true, as the
      non-interactive editor for testing.
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0cf1b72a
    • P
      git p4: work around p4 bug that causes empty symlinks · 40f846c3
      Pete Wyckoff 提交于
      Damien Gérard highlights an interesting problem.  Some p4
      repositories end up with symlinks that have an empty target.  It
      is not possible to create this with current p4, but they do
      indeed exist.
      
      The effect in git p4 is that "p4 print" on the symlink returns an
      empty string, confusing the curret symlink-handling code.
      
      Such broken repositories cause problems in p4 as well, even with
      no git involved.  In p4, syncing to a change that includes a
      bogus symlink causes errors:
      
          //depot/empty-symlink - updating /home/me/p4/empty-symlink
          rename: /home/me/p4/empty-symlink: No such file or directory
      
      and leaves no symlink.
      
      In git, replicate the p4 behavior by ignoring these bad symlinks.
      If, in a later p4 revision, the symlink happens to point to
      something non-null, the symlink will be replaced properly.
      
      Add a big test for all this too.
      
      This happens to be a regression introduced by 1292df11 (git-p4:
      Fix occasional truncation of symlink contents., 2013-08-08) and
      appeared first in 1.8.5.  But it shows up only in p4 repositories
      of dubious character, so can wait for a proper release.
      Tested-by: NDamien Gérard <damien@iwi.me>
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      40f846c3
  11. 23 11月, 2013 1 次提交
  12. 04 9月, 2013 1 次提交
    • K
      git p4: implement view spec wildcards with "p4 where" · 9d57c4a6
      Kazuki Saitoh 提交于
      "git p4" does not support many of the view wildcards, such as * and
      %%n.  It only knows the common ... mapping, and exclusions.
      
      Redo the entire wildcard code around the idea of directly querying
      the p4 server for the mapping.  For each commit, invoke "p4 where"
      with committed file paths as args and use the client mapping to
      decide where the file goes in git.
      
      This simplifies a lot of code, and adds support for all wildcards
      supported by p4.  Downside is that there is probably a 20%-ish
      slowdown with this approach.
      
      [pw: redo code and tests]
      Signed-off-by: NKazuki Saitoh <ksaitoh560@gmail.com>
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9d57c4a6
  13. 13 8月, 2013 1 次提交
  14. 30 7月, 2013 1 次提交
  15. 20 6月, 2013 1 次提交
  16. 12 3月, 2013 1 次提交
    • M
      git p4: avoid expanding client paths in chdir · bbd84863
      Miklós Fazekas 提交于
      The generic chdir() helper sets the PWD environment
      variable, as that is what is used by p4 to know its
      current working directory.  Normally the shell would
      do this, but in git-p4, we must do it by hand.
      
      However, when the path contains a symbolic link,
      os.getcwd() will return the physical location.  If the
      p4 client specification includes symlinks, setting PWD
      to the physical location causes p4 to think it is not
      inside the client workspace.  It complains, e.g.
      
          Path /vol/bar/projects/foo/... is not under client root /p/foo
      
      One workaround is to use AltRoots in the p4 client specification,
      but it is cleaner to handle it directly in git-p4.
      
      Other uses of chdir still require setting PWD to an
      absolute path so p4 features like P4CONFIG work.  See
      bf1d68ff (git-p4: use absolute directory for PWD env
      var, 2011-12-09).
      
      [ pw: tweak patch and commit message ]
      
      Thanks-to: John Keeping <john@keeping.me.uk>
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bbd84863
  17. 27 1月, 2013 13 次提交
  18. 16 1月, 2013 8 次提交