how to detect use of Perforce's "reopen for edit" from a script - scripting

I'm working on a script to interact with Perforce, which among other things needs to be able to understand pending changelists. For this I use 'p4 describe' and 'p4 opened', which are pretty straightforward. For instance, a file opened for edit shows up like this (from p4 opened):
//source/stuff/things.h#1 add default change (text)
What I can't seem to figure out is how to detect cases where a user has branched a file and then used the 'Reopen for edit' command on that file (which amounts to using 'p4 edit' on the file to be branched) prior to submitting it. Same thing goes for integrating a file and then using 'Reopen for edit' before submitting the integration. In the branch case, the file shows up as an 'add' with no indication that there's also a branch going on (so the above example could be either a true add or a reopened branch). In the integrate case it, shows up as an 'edit'. In both cases, after I submit the change I can see that the file was branched/integrated, but I need to be able to do this for pending changes. In theory I would hope to see something like this, where things.h is being branched and edited from thangs.h:
//source/stuff/things.h#1 add default change (text)
branch from //source/other/thangs.h#42
Does anybody know of a way to accomplish this? I'll also mention that I'm running an old-ish version of Perforce (from 2004), so perhaps it's doable in newer versions and I just need to update my software.

"p4 resolved" does almost exactly what you want, but unfortunately it is new in 2007.2.
[C:\dfp\Common\Code\Python]p4 opened foo.py
//buddha/Common/Code/Python/foo.py#1 - add default change (kxtext)
[C:\dfp\Common\Code\Python]p4 resolved foo.py
c:\dfp\Common\Code\Python\foo.py - branch from //buddha/Common/Code/Python/memdump.py#1,#30
You probably won't be able to detect problems before the user runs "resolve", but they're going to have to resolve before they submit.

I do not think that this is possible when issuing a "reopen for edit". As you have already indicated, the reopen command will change a files status to something different. I ran a local test (I'm running 2008.2). There do seem to be some changes in the way that perforce reports on the add/edit status of files since your version, but what you are trying to do still doesn't seem possible
d:\sandbox\ctg_test>p4 integ test.txt test_branch.txt
//ctg_test/test_branch.txt#1 - branch/sync from //ctg_test/Test.txt#1,#15
d:\sandbox\ctg_test>p4 opened
//ctg_test/test_branch.txt#1 - branch default change (text)
Note that the opened command now shows 'branch' for the file status instead of add which I think it might have shown with your version of the server. But the kicker:
d:\sandbox\ctg_test>p4 edit test_branch.txt
//ctg_test/test_branch.txt#1 - reopened for add
d:\sandbox\ctg_test>p4 opened
//ctg_test/test_branch.txt#1 - add default change (text)
I tried looking with the -ztag option to see if more info was given:
d:\sandbox\ctg_test>p4 -ztag opened
... depotFile //ctg_test/test_branch.txt
... clientFile //client-mark.allender/ctg_test/test_branch.txt
... rev 1
... action add
... change default
... type text
... user mark.allender
... client client-mark.allender
p4 fstat was no help either.

Related

Prestashop webvolty, can't change default template, goes back to original state

I am trying to edit prestashop 1.7.5 module of webvolty template. It's just a minor tweak (I want to change translation but don't know how to use default translation files). I just edit display_compare_product.tpl file on my PC, delete one at remote location and upload edited. Every time I do that it almost instantly goes to original state (I can see file size goes to original state after 0,1 s). Any way to force this process or can anyone help me with translation of a string? All i see is pl.php file at translations folder but it's empty.
Apparently you can do that through:
International > Translations
I just did not know that you can also translate ANY string from ANY module with that feature.

Stop direnv showing all environment variables on load

I have direnv installed, and I was wondering if there was a way of stopping it from showing all of the environment variables it loads? The output lines it currently shows are:
direnv: loading .envrc
direnv: export +FOO +BAR +FOO2 +BAR2 +FOO3 +BAR3 +FOO4 +BAR4
I'm fine with having the first line show, but since my second line has something like 50 variables in it, it's slightly annoying to have the lot of them shown every time I go into the directory.
It's possible to remove the logs entirely by setting export DIRENV_LOG_FORMAT= but then the rest of the logs are also missing
As far as I know, you cannot change that behavior through configuration.
If that behavior was part of the stdlib, you could override it. In fact, the first ouput, direnv: loading .envrc comes from source_env which uses log_status to output to stderr, so you could override either of source_env or log_status in ~/.config/direnv/.direnvrc or ~/.direnvrc.
However, the second output is coming from diffString in cmd_export.go (via log_status in log.go). Short of compiling your own, modified version of direnv, I don't see how you can change that behavior as of the current release (v2.17.0).

Odoo 9 - cannot load custom module

I am brand new to odoo, just installed version 9 and made a module 'aidentest' using
.>>python odoo.py scaffold aidentest addons
That created the aidentest module in the addons folder. Uncommented everything in the autogenerated files
but when I went to check out my 'Hello World' page at
http://localhost:8069/aidentest/aidentest
I got a 404 not found
So I went to apps to try and load my module, but I could not find it.
Does anyone know what I need to do on Odoo 9 to load up and start coding my custom module?
Briefly: You have to activate developer mode by going to Top right menu>about>activate developer mode
I had basically given up, and was mindlessly clicking about when I hit the 'About' link on the generic-whiteguy dropdown. I had to actually stop thinking before I was able to locate the completely senseless place where they put the thing I need.
The About modal window popped up, and in it was an activate the developer mode button
Some things changed immediately, but I still couldn't find my custom module.
Then I walked away, came back and when I returned I had some auto-generated emails (new things had loaded - slowly). Did this mean that maybe my module had also become accessible? I checked, and sure enough, there it was.
ZERO DOCUMENTATION about this
Please check the config file.Then send the last error it has.

mogenerator doesn't generate the files

I've just installed mogenerator using one of tutorials. I have added run script to my new target, and clicked Cmd+B. I should get some new files, but i didn't. In my .xcdatamodeld i have 2 entities (User and Repos). Below you can find my print screen of my project.
Where is the problem in my thinking? What should i do more? Please, help me, because i haven't found the solution on the web yet.
This all looks fine (judging by your screenshot).
One thing to check - which caused me the same issue - is that, when you've created your Entities in the xcdatamodelId file, make sure that you click on the Data Model Inspector icon, and that each entity has a Name value, and a matching "Class" value.
Miss out the Class name, and nothing will get generated.
Btw, when you click on Build, do you get a "Build succeeded" message ?
Here's the tutorial I followed to get mogenerator working:
RaptureInVenice
I should say, I've used mogenerator in a few projects, and this command line bit is always the piece that gives me trouble. Sometimes, I have to select my xcdatamodelId file, and create a new Version of it, before mogenerator will use it. But once it is working, it's a blessing.
Anything to avoid having to use the needlessly over-complicated CoreData stuff.
Someone should remind Apple that it's 2014...

how to open jsfiddle with a previous saved version by default

I created a version of my typical daily environment I'm working on (jquery + angular + some personal .js) and I would like to find myself on that base version each time I open jsfiddle.com, instead of finding myself on a blank draft that forces me to go to the dashboard, open the version I would like to work with and fork it.
Is that possible?
not possible, I'd just add your base to bookmarks and use it instead