Re: [PATCH] Git-p4: git-p4.changeOnSubmit to do 'change' instead of 'submit'.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 17/10/11 17:18, Andrei Warkentin wrote:
Hi,

----- Original Message -----
Anyway, the other suggestion I had was to create a new command
instead of overriding behaviour of an existing one. Of course,
copy-pasting P4Submit into P4Change is silly, so...

How about something like this?

The commands dict maps command name to class and optional dict passed to cmd.run(). That way 'change'
can really mean P4Submit with an extra parameter not to submit but to do a changelist instead. The
reason why I initially made the config flag was because I didn't want to copy-paste P4Submit into P4Change.

commands = {
     "debug" : [ P4Debug, {} ]
     "submit" : [ P4Submit, { "doChange" : 0 } ]
     "commit" : [ P4Submit, { "doChange" : 0 } ]
     "change" : [ P4Submit, { "doChange" : 1 } ]
     "sync" : [ P4Sync, {} ],
     "rebase" : [ P4Rebase, {} ],
     "clone" : [ P4Clone, {} ],
     "rollback" : [ P4RollBack, {} ],
     "branches" : [ P4Branches, {} ]
}

Thanks for the review,
A


Sounds plausible to me. The alternative would be a command line parameter, although that could get annoying and error prone, especially as you can't easily unsubmit a perforce change.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]