1

I am trying to edit a changelist description with different user in p4api.net. Is it possible to do it since i tried to edit the changelist description with different user but it didn't allow me. Let me know if there is any forceful way of editing/updating changelist description with different user using p4api.net methods.

-Changelist created by User A.

-Now user B want to update/append in changelist description.

test
  • 91
  • 11

1 Answers1

1

In general, that's a privileged operation. You don't mention if user B is privileged or not. If user B is privileged, that user can update other users's changelists by specifying the 'force' (-f) flag.

From 'p4 help change':

    The -f flag forces the update or deletion of other users' pending
    changelists.  -f can also force the deletion of submitted changelists
    after they have been emptied of files using 'p4 obliterate'.  By
    default, submitted changelists cannot be changed.  The -f flag can
    also force display of the 'Description' field in a restricted
    changelist. Finally the -f flag can force changing the 'User' of
    an empty pending change via -U. The -f flag requires 'admin'
    access granted by 'p4 protect'.  The -f and -u flags are mutually
    exclusive.
Bryan Pendleton
  • 16,128
  • 3
  • 32
  • 56
  • how do i decide whether the user B is privileged or not. So here is the scenario, there are multiple changelist submitted in perforce by User1, User2, User3 and so on. There is one common user say 'CommonUser' want to update changelist Description for all the submitted changelists by User1, User2, User3. Basically 'CommonUser' want to append a line in existing description of all submitted changelist in perforce. I was trying to change it manually in perforce but it didnt allow me. – test May 06 '15 at 17:08
  • public void UpdateChangelistDescription(int clNumber, string desc) { try { var rep = Connect(); var p4Changelist = rep.GetChangelist(clNumber); var opts = new Options(); opts["-f"] = null; opts["-i"] = null; p4Changelist.Description = desc; rep.UpdateSubmittedChangelist(p4Changelist, opts); } catch (Exception exc) { Logger.LogError(exc.Message); throw; } } – test May 07 '15 at 04:45
  • I tried like above but it gave error, you don't have permissions. – test May 07 '15 at 04:47
  • How i can give permissions? – test May 07 '15 at 04:51
  • Your administrator must give you permissions, using the 'p4 protect' command. That's what "The -f flag requires 'admin' access granted by 'p4 protect' means." – Bryan Pendleton May 07 '15 at 13:58