1. 29 8月, 2015 3 次提交
    • L
      git-p4: fix P4 label import for unprocessed commits · b43702ac
      Luke Diamand 提交于
      With --detect-labels enabled, git-p4 will try to create tags
      using git fast-import by writing a "tag" clause to the
      fast-import stream.
      
      If the commit that the tag references has not yet actually
      been processed by fast-import, then the tag can't be created
      and git-p4 fails to import the P4 label.
      
      Teach git-p4 to use fast-import "marks" when creating tags
      which reference commits created during the current run of the
      program.
      
      Commits created before the current run are still referenced
      in the old way using a normal git commit.
      Signed-off-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b43702ac
    • L
      git-p4: do not terminate creating tag for unknown commit · 9ab1cfe5
      Luke Diamand 提交于
      If p4 reports a tag for a commit that git-p4 does not know
      about (e.g. because it references a P4 changelist that was
      imported prior to the point at which the repo was cloned into
      git), make sure that the error is correctly caught and handled.
      rather than just crashing.
      Signed-off-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9ab1cfe5
    • L
      git-p4: honor core.ignorecase when using P4 client specs · a0a50d87
      Lars Schneider 提交于
      Perforce depot may record paths in mixed cases, e.g. "p4 files" may
      show that there are these two paths:
      
         //depot/Path/to/file1
         //depot/pATH/to/file2
      
      and with "p4" or "p4v", these end up in the same directory, e.g.
      
         //depot/Path/to/file1
         //depot/Path/to/file2
      
      which is the desired outcome on case insensitive systems.
      
      If git-p4 is used with client spec "//depot/Path/...", however, then
      all files not matching the case in the client spec are ignored (in
      the example above "//depot/pATH/to/file2").
      
      Fix this by using the path case that appears first in lexicographical
      order when core.ignorecase is set to true. This behavior is consistent
      with "p4" and "p4v".
      Signed-off-by: NLars Schneider <larsxschneider@gmail.com>
      Acked-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a0a50d87
  2. 10 6月, 2015 1 次提交
    • L
      git-p4: fixing --changes-block-size handling · 1051ef00
      Luke Diamand 提交于
      The --changes-block-size handling was intended to help when
      a user has a limited "maxscanrows" (see "p4 group"). It used
      "p4 changes -m $maxchanges" to limit the number of results.
      
      Unfortunately, it turns out that the "maxscanrows" and "maxresults"
      limits are actually applied *before* the "-m maxchanges" parameter
      is considered (experimentally).
      
      Fix the block-size handling so that it gets blocks of changes
      limited by revision number ($Start..$Start+$N, etc). This limits
      the number of results early enough that both sets of tests pass.
      
      Note that many other Perforce operations can fail for the same
      reason (p4 print, p4 files, etc) and it's probably not possible
      to workaround this. In the real world, this is probably not
      usually a problem.
      Signed-off-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1051ef00
  3. 28 5月, 2015 1 次提交
  4. 25 5月, 2015 1 次提交
  5. 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
  6. 21 4月, 2015 1 次提交
  7. 05 4月, 2015 1 次提交
  8. 12 2月, 2015 1 次提交
  9. 24 1月, 2015 1 次提交
  10. 14 6月, 2014 1 次提交
  11. 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
  12. 08 5月, 2014 1 次提交
  13. 08 4月, 2014 1 次提交
  14. 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
  15. 23 11月, 2013 1 次提交
  16. 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
  17. 13 8月, 2013 1 次提交
  18. 30 7月, 2013 1 次提交
  19. 20 6月, 2013 1 次提交
  20. 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
  21. 27 1月, 2013 13 次提交
  22. 16 1月, 2013 2 次提交