/srv/irclogs.ubuntu.com/2012/05/25/#bzr.txt

=== yofel_ is now known as yofel
=== r0bby is now known as robbyoconnor
eagleon1hi guys, I was just wondering if you can help me figure out if my workflow is well thought out, or flawed... might anyone be around to help? :)06:37
eagleon1anyone?06:46
vilaeagleon1: just ask your question or nobody knows if he/she can answer ;)06:50
eagleon1ah ok, thank you vila :) ... well my current situation is this: I am a single developer who works on multiple machines (varying OSes and locations).... and my main line of work is web dev06:52
eagleon1so the goal is to (1) local dev (offline if no connection, like when I am on a flight) .. (2) upload all changes to the remote test server when done in working condition06:52
eagleon1and before starting work on an project, I want to make sure that the machine that I am working on at the time has the latest version06:53
eagleon1so in order to accomplish this I am doing the following:06:53
eagleon11) bzr pull06:53
eagleon12) bzr update06:53
eagleon1then I work on the project and make changes (being confident that I have the latest version on this machine)06:54
eagleon13) after making changes (online or offline) I make local commits along the way...06:54
eagleon14) when I am ready to test it on the test server, I do a bzr upload06:55
eagleon15) then a bzr push06:55
eagleon1thats it!06:55
vilaThat sounds correct.06:55
eagleon1at this point, I assume the remote test server (e.dg www.example.com/test) is the latest version06:55
eagleon1so the next time I do a pull, it will also be from here...06:56
eagleon1:) correct! yay!06:56
eagleon1in the docs, I was reading about 'bzr checkout' ... this is not necessary then right?06:56
vilaA couple of questions though: where are your branches, do you have one on the test server (and/or the production server)06:56
eagleon1when ever I create a new project, I will create a branch for that project on the test server... then get it locall using the step #1 above...06:57
eagleon1for that, I will only do bzr init, bzr add znd bzr commit06:57
vilaok, so you have a bzr branch on the test server. Is bzr installed there ?06:58
eagleon1yep installed and ready :)06:58
vilaso you can use the bzr-push-and-update plugin instead of bzr-upload06:58
eagleon1ah, excellent! whats the difference in this case?06:59
vilaIf you haven't (yet) read http://wiki.bazaar.canonical.com/MatthewFuller/SpotDocs/PiecesInBrief you can ;)06:59
vilaworking trees and branches are especially relevant here06:59
eagleon1havent, but will do right now! thanks :)06:59
vilayou have to understand that a working tree can be in sync or not with its associated branch (they generally are)07:00
eagleon1im still new to versioning ... terms like branches and tress can be a little confusing in terms of application (vague)... but this link might help understand ...07:00
vilaIn some cases, one can push to a branch but the working tree is not updated07:00
eagleon1oh I see07:01
vilaroughly, the working tree is the files you're editing, when you do a commit, a revision is created and becomes the branch's new tip07:01
eagleon1I understood everything up to the point where the revision is created...07:02
eagleon1so a branches new tip is the version history data?07:02
vilaso, a branch is a directed graph of revisions (the history of your work, the tip being the most recent revision and the graph entry point)07:03
eagleon1oh got it, that makes sense07:03
vilaso, back to your workflow,07:03
vilamost of the time, (bzr branch, bzr init, bzr pull), your WT is updated automatically so your step (2) is probably not required07:05
eagleon1ok, thats good to know07:05
eagleon1so that would be a redundant step07:05
eagleon1but I didn't have bzr branch in my workflow before,07:06
vilaif you install and configure bzr-push-and-update (requires ssh access to the server), your step (4) becomes useless too07:06
eagleon1ssh access is ready07:06
eagleon1thats good!07:06
vilaand if in (5) you're pushing to the same place that you're uploading in step (4), you're on thin ice07:06
vila,,,07:06
vila...07:06
eagleon1in what sense (and yes, it is the same place) ...07:07
vilaI thought bzr-upload will refuse to upload to an existing branch... am I wrong ?07:07
eagleon1no it uploads07:07
eagleon1ive been testing this workflow for a bit now, but I dont know when I am really working on a project what sort of variables might mess things up07:07
vilaand you then push to the exact same url ?07:07
eagleon1yes07:08
vilahmm, anyway, that's still risky :)07:08
eagleon1how come? :)07:08
eagleon1just asking to know... i believe you tho, I want to understand this better07:09
vilaso, if you have ssh access *and* you already maintain a branch there, better use push-and-update07:09
vilawell, bzr-upload is targetted at uploading a tree relying on a local branch07:09
eagleon1yes, the branch will always be created on the remote test server first07:09
eagleon1(in some cases i may create it locally and send it to the remote server) then sync back... if I want to do that, will push-and-upload have any conflict?07:11
vilabzr-upload needs to upload the whole files, whereas 'bzr update' running remotely (via push-and-update) deals with local files07:11
vilapush-and-update :)07:11
vilano, it's fine07:11
eagleon1cool07:11
eagleon1this is great, I am so glad I asked... your help is invaluable :)07:11
vilain a nutshell: if you have bzr installed where you want to push, use bzr-push-and-update,07:12
vilaif you don't have bzr installed OR don't want your bzr branch to be readable (think production servers), use bzr-upload07:12
vilahappy to help ;)07:12
eagleon1oh, right~ I was thinking on putting things manually to production servers without bzr involved (but perhaps knowing this may make a difference, once I am vry comfortable with bzr) ...07:13
eagleon1one last question if you dont mind vila... what about "checkouts" they are not necessary right?07:14
eagleon1checkins and checkouts?07:14
vilawell, no, they aren't07:14
eagleon1in the docs, I read that I would use a checkout if I am a single dev working on multiple machines07:14
eagleon1just out of curiosity, in what situation would a checkout be appliable over this workflow that I have (with the changes you recommended)07:15
eagleon1*applicable07:15
vilait would make sense if you're working on the same project from multiple machines07:15
eagleon1I am though, that's the thing07:16
vilaby same project, I mean a 'master' branch on a central server07:16
eagleon1oh...07:16
vilaand it works really well if you're always online and the server is always accessible too07:16
eagleon1hmm... no my setup is more "distributed" than centralized, if that correct?07:17
eagleon1*is07:17
eagleon1i may not always have access to the net, as I travel a lot07:17
vilaoutside of these constraints... you need to be more careful and rigorous about committing (locally) when you've been offline and run 'bzr update' before starting edits again07:17
fullermdWhen you're push'ing and pull'ing stuff around, you basically have 2 (or 3, or 4, or more) independent branches, that you opportunistically sync up.07:17
vilaeagleon1: what have you done !!! You said 'checkout' !!!07:18
fullermdWith checkouts, you conceptually have _one_ branch, and 2 (or 3, or 4, or...) different working trees you work on it from.07:18
eagleon1hmmm07:19
eagleon1again, slightly confused ... let me go over this for a second07:19
fullermdAnd you never ever use commit --local, because it's the devil.  See those two l's at the ends of the word?  Those are its horns.07:19
vilahehe07:19
eagleon1ah :p07:19
vilaso, basically, avoid checkouts until they *really* make your life easier :)07:20
eagleon1thats' a great way to remember never to do it, thanks fullermd07:20
eagleon1will do vila... right now, they dont seem to apply to me07:20
vilaeven bound branches are clearer to use when you're offline from time to time07:20
fullermdAnd if you don't immediately see how they make your life easier, they probably don't at this point.07:20
eagleon1yeah, my priorities are to always have the latest version on the local machine that I am working on when I begin coding, then when I finish that latest version needs to be on the test server (which acts as my source if I start working on another machine later)07:21
eagleon1my biggest concern is losing any work by forgetting a step.. :-S ...07:22
eagleon1is that possible?07:22
vilawell, pull before your start, push before you end07:23
eagleon1by push you mean push-and-update right?07:23
fullermdOr after you end   ;p07:23
eagleon1haha07:23
vilaoh no, *before*, you're not finished until you do that :)07:23
eagleon1thats true indeed07:24
vilaeagleon1: oh, and 'bzr missing' is your friend when you don't remember if you did07:24
vila(pull or push)07:24
eagleon1excellent, ill read up on missing as well07:24
fullermdIf you make some changes in one place, and don't push them before you start working in another, you'll wind up with two branches that have diverged (both have changes the other doesn't).07:24
vila'bzr config' and 'bzr info' will also remind you of which branches you're dealing with07:25
eagleon1also I suspect 'bzr add' and 'bzr remove' are crucial07:25
fullermdBut that's not any sort of problem; you can just merge them later.  You just won't have the changes from one place in the other until you do.07:25
vilathey're pre-requisites of 'bzr commit' IMHO07:25
vila'bzr add/remove' are pre-requisites of 'bzr commit' IMHO07:25
vilaso yeah, 'bzr st' is the moral equivalent of 'bzr missing'07:26
eagleon1moral equivalent meaning?07:26
fullermdYes, there are basically two different sets of commands you work with.  One is the "I'm making new stuff" set, where you have add/rm/mv/stat/commit/etc.07:26
fullermdThe other is the "I'm getting the stuff I've made where it needs to be to deploy/continue deving", where you have push/pull/missing/etc.07:27
eagleon1hmm, this new info completely upgrades my workflow from what I had in mind initially07:27
vilaso, 'bzr st/bzr diff' is the last command before 'bzr commit', where 'bzr missing' is the last command before 'bzr pull/push'07:27
eagleon1got it, I hadn't even thought of those previously... thanks vila and fullermd07:28
vilayou're welcome07:28
vilafullermd: thanks to you too ;)07:28
eagleon1:)07:28
fullermdvila: 'k.  Now let's find someone new to confuse!07:29
eagleon1haha07:29
eagleon1wow, I just realized... being on the #python chat room has truly deciplined me to no lol07:29
eagleon1cos their bot keeps bugging you whenever you type lol there :p07:29
eagleon1so now I keep typing haha by habbit :-S ...equally bad or worse07:29
* vila checks #bzr bot, you slacker07:30
eagleon1by the way, what is the lp: stand for... like in bzr branch lp:bzr-push-and-pull07:39
eagleon1I mean push-and-update... :/07:40
vilahehe07:40
vilait's a shorcut for launchpad branches07:41
eagleon1ah cool :D07:41
eagleon1moving a branch if ever necessary (using the file system itself) should be safe right? I just pulled the push-and-update plugin into the bzrlib dir insited of inside the plugins dir... so doing a mv to where it belongs, should not break anything right?07:44
eagleon1hmm, there is no setup.py for this plugin... so I assume it will work as long as it is in the plugin dir?07:46
fullermdExcept in the case where it was made in a shared repo (init-repo), and you mv it out of the repo.07:46
eagleon1oh, got it!07:46
mgzmorning08:24
fullermdI don't remember authorizing that.08:25
eagleon1morning :)08:25
eagleon1authorizing what?08:25
fullermdMornings.  They're bad news.08:25
eagleon1oh ... sorry to hear that, did I miss something.. your comment seemed random ... :/08:26
fullermdYou say that as if it's something unusual...08:26
mgzit's fulldermd's normal greeting :)08:26
eagleon1ah! :P08:26
eagleon1im new here, so its good to know that now :D08:27
mgzin fact, these days I'm not convinced it's actually random08:28
mgzI think he's just pseudo-random08:29
eagleon1lol08:29
fullermdBeing completely unpredictable was getting predictable.  I had to switch to pre-planned things so it didn't look pre-planned.08:29
eagleon1oh darn, you just gave it away...08:30
fullermdOr DID I??08:30
eagleon1:-O08:31
eagleon1hi guys, I am wondering what I am doign wrong here...08:39
eagleon1$ bzr push-and-update08:39
eagleon1bzr: ERROR: Not a branch: "/usr/lib/python2.6/site-packages/bzrlib/plugins/".08:39
mgzrun `bzr info` in the same location?08:47
eagleon1oh right, im not inside a branch... :( silly me08:49
eagleon1:)08:49
eagleon1thanks mgz08:49
vilahmm, I thought push-and-update could be configured to trigger automatically when one do push...08:56
vilahi mgz (sry for the delay ;)08:56
eagleon1is that possible?08:59
vilaaccording to the code, it's the default behavior, as long as the url used hints that ssh is involved09:02
vilagive it a try09:02
vilai.e. no configuration needed09:02
eagleon1will do, im stil documenting what we discussed earlier before I forget :D09:02
vilagood choice :)09:02
eagleon1all while watching hacker attempting to breach my production server09:03
vilayeah, always entertaining09:03
eagleon1indeed09:03
eagleon1hi guys, when limiting the ssh account that I use to connect to the remote server (when doing a pull) ... what commands should I supply?09:38
eagleon1what arguments should be there for example09:38
vilaI never remember the details for that as I rely on using only keys to connect to ssh servers09:39
eagleon1yeah, even with the keys its better to limit the ssh user i think...09:40
vilanote that having ssh access is enough to use the bzr smart server, the bzr client will execute the right command remotely09:40
eagleon1i never connect with a previledged account09:40
eagleon1hmm09:40
vilaand if you use bzr-push-and-update, you need to allow a different command for that too09:41
vilait's certainly doable but I've never done it myself09:41
eagleon1I guess I will have to allow some freedom to this user then...09:42
eagleon1will definitely have to limit bzr to the test server, and update production manually for now..09:42
vilayou can use a dedicated key on the test server and pull from the production server09:43
mgzprobably don't need to be too paranoid09:43
vilahehe, all paranoids will disagree with that I think :)09:44
eagleon1well im getting hacker attempts daily, but the hour.. so a bit paranoid ... :-s09:44
eagleon1*by the hour09:44
fullermdWhat?!  How did you know I'd disagree???09:44
vila. o O (Damn it, damn it, quick, the dried frog pills)09:44
eagleon1im actually extra paranoid today because they are trying to brute force a specific user account that I created recently... how did the know it exists!?!09:45
eagleon1although the brute force wont work, im still worried about how they got that specific user name09:45
eagleon1made up of random letters09:45
vilawow09:46
fullermdWell, I certainly didn't tell them via a scrawled note I dropped in a basket outside the local Burger King between 2200 and 2230 last night.09:46
fullermdThat would be suspicious after all.09:46
eagleon1lol09:46
vilaeagleon1: still, they are trying passwords, if you disallow that on your ssh server allowing only keys, you're done09:46
fullermdNono, everybody knows you're supposed to run sshd on a different port.  Then you're totally safe forever.09:47
eagleon1yeah, im already doing that so safe there... but still wondering how they got that username09:47
eagleon1(last comment was in response to vila :p)09:47
eagleon1can they sniff an user name during connect time, even if I was attempting via ssh?09:48
eagleon1i wonder09:48
fullermdObviously what you thought was random was really only pseudo-random.  We know how that turns out.09:48
eagleon1indeed :P09:48
vilaif they were able to sniff user names, I'd call that a very big security hole09:50
eagleon1exactly :-S09:51
vilaeagleon1: are you really saying you see hack attempts on a non-standard port with a random user name ?09:53
vilaI'm curious about which of your assumptions is wrong...09:53
vilabecause if they are all true, you're in trouble :)09:53
eagleon1no, they are attempting on a standard port with a known username...10:11
eagleon1(as well as random ones)10:11
eagleon1but they only get past 3 attempts with each IP... after that they need to go find more proxies from china :p10:12
vilaeagleon1: fail2ban for the win ?10:42
eagleon1yes indeed :)10:43
eagleon1by the way, does bzr commands need to always be run withing the working dir of the branch? is it possible to provide the path of the branch to other commands, like bzr push [host] [branch?] ... unlikely right?10:44
mgzall commands should either take a path as a param, or -d to tell them where to operate10:51
eagleon1so bzr push -d /home/user/file/ bzr+ssh://.... is good?10:58
eagleon1i dont see -d in the help files..11:01
eagleon1i think bzr bind is what I was looking for,11:03
mgzI... doubt it?11:03
eagleon1really?11:03
mgzwhat are you actually trying to do?11:04
* fullermd is pretty sure "not bind" is the answer too :p11:04
fullermd-d is right there in push's help, frex...11:04
eagleon1hmm.. well what im trying to do... lets say im in /home/user11:04
eagleon1i have a branch in /home/user/test11:05
eagleon1without going inside 'test', while being in /home/user, i want to perform the bzr push (or any bzr command)11:05
eagleon1i couldn't see the -d in my push's help ... let me check again11:06
mgz(cd test && bzr anything)11:06
mgzmagic, you've not changed location :)11:06
mgzotherwise -d is what you want for many commands11:09
eagleon1ah, nevermind.. looks like i was looking at bzr update's help ... which dosen't have it... my bad, but still missing for this command11:09
eagleon1mgz, i think you magic command is what im going to use :D thx11:10
eagleon1nevermind :P11:10
eagleon1that changes location..11:11
eagleon1the problem is that I need to execute this as a python subprocess.call11:12
mgzthat's not a problem surely11:13
eagleon1yea, actualy its not lol11:13
mgzthat has a param to set the cwd of the process you're spawning11:13
eagleon1really? :-o I didnt know that...11:13
eagleon1thanks mgs, that helps11:14
eagleon1*mgz (sorry)11:14
Merwinhi !12:30
jelmerhi Merwin12:36
=== elmo_ is now known as elmo
=== mbarnett` is now known as mbarnett
vilajelmer: what needs to be done for 2.5.1  ? An SRU for precise ? Something for quantal (or should that be some 2.6bx there) ?15:46
jelmervila: an SRU for precise16:04
vilajelmer: ok, can you take care of that ?16:05
jelmervila: sure16:19
vilacool, thanks16:20
=== deryck is now known as deryck[lunch]
=== deryck[lunch] is now known as deryck
=== Noldorin_ is now known as Noldorin
eagleon1hi18:51
eagleon1i keep getting this strange error: This transport does not update the working tree of: bzr+ssh://18:52
fullermdThat's not an error, just a notice.  Thought it does get old pretty quick.18:52
eagleon1bzr+ssh is supposed to be a supported transport, right?18:52
fullermdIt's just telling you it doesn't update remote working trees.18:53
eagleoni keep getting this strange error: This transport does not update the working tree of: bzr+ssh://18:55
eagleonbzr+ssh is supposed to be a supported transport, right?18:55
eagleonfor the push-and-upload plugin?18:56
fullermdI dunno if push-and-upload can or bothers suppressing the message from push.18:56
eagleonhmm... either way, its not working :(18:57
fullermdpush-and-update I think it's called, rather.18:57
eagleonyeah.. thats what i meant, sorry18:57
eagleonit works with just doing a bzr push18:57
eagleonafter its installed18:58
eagleonim tempted to go back to the bzr upload solution like I wanted to originally... but also cant rest until i can figure out why this is broken... :-S19:00
fullermdWhat's broken?  I thought you said it works.19:01
eagleonnope :( ... basically the push-and-update dosen't work... let me show you, one sec19:03
fullermd13:57 <eagleon> it works with just doing a bzr push19:03
fullermdI presume "it" means the WT gets updated.19:03
eagleonoh... what I meant by that is that doing a bzr push actaully calls the push-and-update plugin when it is installed ... sorry for the lack of clarity, but the WT does not update19:04
eagleoni get the following error: This transport does not update the working tree of: bzr+ssh://user@domain...19:05
fullermdThat's coming from push.  Unrelated to whatever the problem is.19:05
eagleonhmm19:05
eagleonlet me show you the whole error, it might make more sense19:05
fullermdpush-and-update basically just adds a hook into things so that when you run "bzr push bzr+ssh://server/some/path", it goes in afterward and runs "ssh server ; cd /some/path && bzr up"19:06
fullermdIt doesn't change the push process itself to do anything to the WT.19:06
eagleonhttp://dpaste.com/752205/19:08
eagleonhmm19:08
fullermd'k, well that seems reasonably self-explanatory.19:09
eagleonyou mean the host name?19:09
fullermdYah.19:09
eagleonthe funny thing about that, is that it connects to the server.. then I even get authenticated (password request pops up) I enter the pass and then this happens19:10
fullermdssh takes a hostname as an arg, not something like a URL fragment.  The plugin apparently doesn't do necessary translations.19:10
eagleonah19:10
fullermdThat password prompt is probably from the push, not the update.19:10
eagleongot it,that makes sense19:11
fullermdI doubt there's an in-bzr workaround short of extending the plugin's capabilities.19:11
eagleoni guess a simple work around would be to just run the update myself without the plugin19:11
fullermdMe, I'd avoid the issue entirely by just using sshconfig.19:11
fullermdSaves worrying with usernames too.19:11
eagleonwhats that? im not familair with it19:11
fullermdAdd an entry into your ssh config setting the port and the username; then you don't need to specify any of it.19:12
eagleonhmm19:12
eagleonwithin my user's ssh config right?19:13
fullermdYeah.19:13
eagleonnot related to bzr?19:13
fullermdSomething like19:13
eagleonoh ok..19:13
fullermdhttp://dpaste.com/752206/19:13
fullermdThen you could just 'bzr push bzr+ssh://bzr.example/where/ever'19:13
eagleonah yes, this shoud work nicely19:13
fullermd(my config has tabs for the following lines; I don't know if spaces work or not, but I didn't feel like trying to sneak them into bpaste)19:13
eagleonyeah, the probably do work... but I prefer tabs myself19:14
eagleon*they19:14
eagleonthanks so much for the tip19:14
fullermdI got sick of remembering all the usernames I have to deal with a good while back, and started accumulating lines in .ssh/config   ;p19:15
eagleonah yes :)19:15
eagleonthis is definitely helpful19:15
eagleononly problem that I see however, is that since I work on multiple machines...19:15
eagleonill have to update each of them :-S19:15
* fullermd . o O ( cd ~/.ssh ; bzr init ; bzr add ; bzr ci -m 'Version one copy of this I can share' ; bzr push .... )19:16
fullermdA little recursion is good for the soul   :p19:16
eagleonha! :D19:17
eagleonnever thought of that... good solution! and it keeps things versioned too :D19:18
fullermdOh, yes, I've got a lot of little bzr branches like that around, just to have a little history on configs.19:19
fullermd(.ssh/config being one; a little branch with nothing in it but .bzrignore and config...)19:20
eagleonactually... this would even work nicely on some /etc/...19:20
fullermdAlso a branch on all my systems   :p19:20
eagleon:D19:21
fullermdAs is /usr/local/etc.  /usr/local/etc/apache22 is usually another one.19:21
eagleonI never saw bzr this way until now, this is going to make my life so much easier :D19:21
fullermdOne for postfix config, on the boxes where it matters.  nginx one or two places.19:21
eagleonthank you x ~19:21
fullermdI've even got a ~/.rc-files for the handful of little rc files that don't have anything else to justify a branch by themselves.19:22
eagleonnice19:22
fullermd(files symlinked to ~.  e.g., "/home/fullermd/.vimrc@ -> .rc-files/.vimrc")19:22
eagleondo you backup the branches somewhere also or just on the local machine?19:22
eagleonor server19:23
fullermdNone of those branches ever get pushed anywhere, or deal with merges or any of that.  They're mostly just so I have a history of what's been done, and a backup if I accidentally rm the file or dd too many lines, or need to backout changes, etc.19:23
fullermdMost of 'em don't get explicitly backed up themselves, though they get caught in sweeping backups of the surrounding FSen.19:24
eagleonyeah, very cool!19:24
eagleonFSen?19:24
fullermdWell, how else would you pluralize "FS"?19:24
eagleonFSes? :D19:25
fullermdThat doesn't sound nearly as cool.19:25
eagleoni disagree... :P19:25
eagleonthen again, maybe ur right19:25
fullermdOf course I am.  It's one of the rules.19:25
eagleonlol19:25
eagleonbesides, confusing is cool and it just happens to be your style from what i've been gathering lately :D19:26
fullermdAm I that predictable?  Good.19:26
eagleonhow come you are always online? :p its awesome19:31
fullermdWell, the alternative would be to get a life.  And who has time for that?19:32
eagleonindeed!..19:32
eagleonthats what I always say19:32
* fullermd shrugs.19:34
fullermdI work a lot.  And my IRC window is always sitting there anyway.19:34
eagleonyes, thats what I tell everyone as well.. they never beieve19:34
fullermdInfidel defilers.  They shall all drown in lakes of blood.19:35
eagleon:-O19:36

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!