1. 17 9月, 2012 5 次提交
    • P
      git p4: test clean-up after failed submit, fix added files · f7fbc981
      Pete Wyckoff 提交于
      Test a variety of cases where a patch failed to apply to
      p4 and had to be cleaned up.
      
      If the patch failed to apply cleanly, do not try to remove
      to-be-added files, as they have not really been added yet.
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Acked-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f7fbc981
    • P
      git p4: standardize submit cancel due to unchanged template · 5a41c16a
      Pete Wyckoff 提交于
      When editing the submit template, if no change was made to it,
      git p4 offers a prompt "Submit anyway?".  Answering "no" cancels
      the submit.
      
      Previously, a "no" answer behaves like a "[s]kip" answer to the
      failed-patch prompt, in that it proceeded to try to apply the
      rest of the commits.  Instead, put users back into the new
      "[s]kip / [c]ontinue" loop so that they can decide.  This makes
      both cases of patch failure behave identically.
      
      The return code of git p4 after a "no" answer is now the same
      as that for a "skip" due to failed patch; update a test to
      understand this.
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Acked-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5a41c16a
    • P
      git p4: move conflict prompt into run, add [q]uit input · 7e5dd9f2
      Pete Wyckoff 提交于
      When applying a commit to the p4 workspace fails, a prompt
      asks what to do next.  This belongs up in run() instead
      of in applyCommit(), where run() can notice, for instance,
      that the prompt is unnecessary because this is the last commit.
      
      Offer two options about how to continue at conflict: [s]kip or
      [q]uit.  Having an explicit "quit" option gives git p4 a chance
      to clean up, show the applied-commit summary, and do tag export.
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Acked-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7e5dd9f2
    • P
      git p4: remove submit failure options [a]pply and [w]rite · 449bb9cf
      Pete Wyckoff 提交于
      When a patch failed to apply, these interactive options offered
      to:
      
          1) apply the patch anyway, leaving reject (.rej) files around, or,
          2) write the patch to a file (patch.txt)
      
      In both cases it suggested to invoke "git p4 submit --continue",
      an unimplemented option.
      
      While manually fixing the rejects and submitting the result might
      work, there are many steps that must be done to the job properly:
      
          * apply patch
          * invoke p4 add and delete
          * change executable bits
          * p4 sync -f renamed/copied files
          * extract commit message into p4 change description and
            move Jobs lines out of description section
          * set changelist owner for --preserve-user
      
      Plus the following manual sync/rebase will cause conflicts too,
      which must be resolved once again.
      
      Drop these workflows.  Instead users should do a sync/rebase in
      git, fix the conflicts there, and do a clean "git p4 submit".
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Acked-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      449bb9cf
    • P
      git p4: gracefully fail if some commits could not be applied · 67b0fe2e
      Pete Wyckoff 提交于
      If a commit fails to apply cleanly to the p4 tree, an interactive
      prompt asks what to do next.  In all cases (skip, apply, write),
      the behavior after the prompt had a few problems.
      
      Change it so that it does not claim erroneously that all commits
      were applied.  Instead list the set of the patches under
      consideration, and mark with an asterisk those that were
      applied successfully.  Like this example:
      
          Applying 592f1f9 line5 in file1 will conflict
          ...
          Unfortunately applying the change failed!
          What do you want to do?
          [s]kip this patch / [a]pply the patch forcibly and with .rej files / [w]rite the patch to a file (patch.txt) s
          Skipping! Good luck with the next patches...
          //depot/file1#4 - was edit, reverted
          Applying b8db1c6 okay_commit_after_skip
          ...
          Change 6 submitted.
          Applied only the commits marked with '*':
            592f1f9 line5 in file1 will conflict
          * b8db1c6 okay_commit_after_skip
      
      Do not try to sync and rebase unless all patches were applied.
      If there was a conflict during the submit, there is sure to be one
      at the rebase.  Let the user to do the sync and rebase manually.
      
      This changes how a couple tets in t9810-git-p4-rcs.sh behave:
      
          - git p4 now does not leave files open and edited in the
            client
      
          - If a git commit contains a change to a file that was
            deleted in p4, the test used to check that the sync/rebase
            loop happened after the failure to apply the change.  Since
            now sync/rebase does not happen after failure, do not test
            this.  Normal rebase machinery, outside of git p4, will let
            rebase --skip work.
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Acked-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      67b0fe2e
  2. 13 7月, 2012 1 次提交
  3. 06 7月, 2012 3 次提交
  4. 12 5月, 2012 2 次提交
  5. 01 5月, 2012 3 次提交
    • P
      git p4: submit files with wildcards · 9d7d446a
      Pete Wyckoff 提交于
      There are four wildcard characters in p4.  Files with these
      characters can be added to p4 repos using the "-f" option.  They
      are stored in %xx notation, and when checked out, p4 converts
      them back to normal.
      
      When adding files with wildcards in git, the submit path must
      be careful to use the encoded names in some places, and it
      must use "-f" to add them.  All other p4 commands that operate
      on the client directory expect encoded filenames as arguments.
      
      Support for wildcards in the clone/sync path was added in
      084f6306 (git-p4: decode p4 wildcard characters, 2011-02-19),
      but that change did not handle the submit path.
      
      There was a problem with wildcards in the sync path too.  Commit
      084f6306 (git-p4: decode p4 wildcard characters, 2011-02-19)
      handled files with p4 wildcards that were added or modified in
      p4.  Do this for deleted files, and also in branch detection
      checks, too.
      Reported-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9d7d446a
    • P
      git p4: fix writable file after rename or copy · b6ad6dcc
      Pete Wyckoff 提交于
      The way rename works is with a "p4 integrate", optionally
      followed by a "p4 edit" if the change is not a 100% rename.
      Contents are generated by applying a patch, not doing a file
      system rename.  Copy is similar.
      
      In this case, p4 does not fix the permissions back to read-only.
      Make sure this happens by calling "p4 sync -f".
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b6ad6dcc
    • P
      git p4: bring back files in deleted client directory · 8d7ec362
      Pete Wyckoff 提交于
      The code to auto-create the client directory, added in 0591cfa8
      (git-p4: ensure submit clientPath exists before chdir,
      2011-12-09), works when the client directory never existed.
      
      But if the directory is summarily removed without telling p4,
      the sync operation will not bring back all the files.  Always
      do "sync -f" if the client directory is newly created.
      Reported-by: NGary Gibbons <ggibbons@perforce.com>
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8d7ec362
  6. 25 4月, 2012 3 次提交
  7. 12 4月, 2012 1 次提交
    • L
      git p4: import/export of labels to/from p4 · 06804c76
      Luke Diamand 提交于
      The existing label import code looks at each commit being
      imported, and then checks for labels at that commit. This
      doesn't work in the real world though because it will drop
      labels applied on changelists that have already been imported,
      a common pattern.
      
      This change adds a new --import-labels option. With this option,
      at the end of the sync, git p4 gets sets of labels in p4 and git,
      and then creates a git tag for each missing p4 label.
      
      This means that tags created on older changelists are
      still imported.
      
      Tags that could not be imported are added to an ignore
      list.
      
      The same sets of git and p4 tags and labels can also be used to
      derive a list of git tags to export to p4. This is enabled with
      --export-labels in 'git p4 submit'.
      Signed-off-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      06804c76
  8. 10 4月, 2012 2 次提交
  9. 27 2月, 2012 2 次提交
  10. 24 2月, 2012 1 次提交
    • L
      git-p4: add initial support for RCS keywords · 60df071c
      Luke Diamand 提交于
      RCS keywords cause problems for git-p4 as perforce always
      expands them (if +k is set) and so when applying the patch,
      git reports that the files have been modified by both sides,
      when in fact they haven't.
      
      This change means that when git-p4 detects a problem applying
      a patch, it will check to see if keyword expansion could be
      the culprit. If it is, it strips the keywords in the p4
      repository so that they match what git is expecting. It then
      has another go at applying the patch.
      
      This behaviour is enabled with a new git-p4 configuration
      option and is off by default.
      Acked-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      60df071c
  11. 23 2月, 2012 1 次提交
  12. 27 1月, 2012 2 次提交
  13. 21 1月, 2012 3 次提交
  14. 12 1月, 2012 3 次提交
  15. 04 1月, 2012 4 次提交
  16. 28 12月, 2011 4 次提交