1

For branching I from a certain CL and have it as a changelist I realized that Perforce uses the copy keyword. I'm tryin to use the same keyword but getting an error saying that the options are invalid. Following is my code:

result = self.p4.run("copy","-c" + change_List,"-F", Path_1+"/...@"+ CL, Path_2+"/...")

am I doing something wrong? Can anyone explain to me what the wrong part of my code is?

Payam30
  • 689
  • 1
  • 5
  • 20

1 Answers1

0

See the usage info for p4 copy:

C:\Perforce\test>p4 help copy

    copy -- Copy one set of files to another

    p4 copy [options] fromFile[rev] toFile
    p4 copy [options] -b branch [-r] [toFile[rev] ...]
    p4 copy [options] -b branch -s fromFile[rev] [toFile ...]
    p4 copy [options] -S stream [-P parent] [-F] [-r] [toFile[rev] ...]

        options: -c changelist# -f -n -v -m max -q

There is no form of the command that takes multiple file arguments and a -F flag. The -F flag is only applicable if you're using streams, since its purpose is to allow you to override the defined "flow" of the two streams.

Samwise
  • 68,105
  • 3
  • 30
  • 44
  • What I am trying to branch from a main-branch, with a specific CL, to release branch. I saw from the perforce command window that it runs this command. if I want to branch from branch a (which normally is the main stream) to a release branch isn't copy a good option? – Payam30 May 17 '20 at 00:58
  • For creating a new branch it's more efficient to use `populate`, but if you don't care about runtime, `copy` and `integrate` are about equally good. In any case, you need to use the command correctly (i.e. don't pass random nonsense as args) for it to work. :) – Samwise May 17 '20 at 04:50