Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p4.changes examples #14

Open
cope opened this issue Aug 27, 2015 · 3 comments
Open

p4.changes examples #14

cope opened this issue Aug 27, 2015 · 3 comments

Comments

@cope
Copy link
Contributor

cope commented Aug 27, 2015

Could you please give an example for the changes command?

Particularly how do we use the parameters listed here: http://www.perforce.com/perforce/r15.1/manuals/cmdref/p4_changes.html

For example, how could I add option "@2011/04/01,@now" to that call?

p4 changes @2011/04/01,@now
@cope cope changed the title Examples p4.changes examples Aug 27, 2015
@gmaghera
Copy link
Contributor

Here you go:

var p4 = require('node-perforce');

p4.changes({files: ['@2015/12/23,@now']}, function(err, result){
    console.log(result);
});

@cope
Copy link
Contributor Author

cope commented Dec 21, 2015

9d6x6pm_700wa_0

@gmaghera
Copy link
Contributor

I've updated the example, as it was incorrect. The revision range argument needs to be placed inside a JSON object, and not as a string as I had in the initial example. There is a limit to how much data you can extract this way. If the revision range returns a huge number of changes, you'll get a buffer error.

Sorry to lead you astray with the previous example. It ended up outputting all the changes, not just the ones defined in the revision range. I happened to be working in a DVCS Perforce environment, where there was only one change, which matched the revision range by coincidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants