GNOME Bugzilla – Bug 628181
Conflicts in /home/admin/bin
Last modified: 2010-08-28 18:00:46 UTC
I'm playing with create-auth. Noticed the following conflict. This prevents me from doing anything. As I don't understand Git much, I'm going to try and clean all the changes. # git diff diff --cc copy-db.py index 83a36d5,ac6b1ef..0000000 --- a/copy-db.py +++ b/copy-db.py @@@ -153,17 -121,10 +153,22 @@@ for db in dbs hotcopy.wait() else: verbose("Backing up %s via mysqldump" % db) - outfilename = os.path.join('/var/lib/mysql-backup', db_filename + ".dump.gz") + outfilename = os.path.join(backup_dir, db_filename + ".dump.gz") outfilename_tmp = outfilename + ".tmp" ++<<<<<<< HEAD:copy-db.py + + # Add a bit of error checking before freaking out + if not os.path.exists(backup_dir): + sys.stderr.write("ERROR: '%s' does not exist to backup files into\n" % backup_dir) + sys.exit(1) + if not os.access(backup_dir, os.W_OK): + sys.stderr.write("ERROR: '%s' is not writable\n" % backup_dir) + sys.exit(1) + ++======= + # Create the backup directory if it doesn't exist + os.makedirs(os.path.dirname(outfilename)) ++>>>>>>> Create the mysql backup directory before opening the file in copy-db.py:copy-db.py outfile = open(outfilename_tmp, "w") dump = subprocess.Popen(['mysqldump', '--single-transaction',
This seems to be a local conflict on your machine - I don't see it either in the repository or in /home/admin/bin. What the conflict shows is that you made the change: ++======= + # Create the backup directory if it doesn't exist + os.makedirs(os.path.dirname(outfilename)) ++>>>>>>> Create the mysql backup directory before opening the file in and committed it locally but didn't push. Then when you pulled/rebased you got a conflict. Since you have a conflict, your git repository is most likely still in the middle of the rebase. (See the "git branches in shell prompt" tip in http://live.gnome.org/Git/Tips for something that helps a lot there.) To keep it simple, here's what I'd suggest. 1) copy your changes to create-auth to a safe place 2) git rebase --abort # get rid of the existing rebase, if I'm guessing your state right 3) git log origin/master.. # see what changes you have locally that aren't upstream [ If you don't want any of those changes and just want to throw them away ] 4) git reset --hard origin/master [ If you do want some of those changes, then git git rebase origin/master and follow git docs for resolving conflicts ] 5) copy your create-auth back 6) git diff [ read the diff to make sure that copying your local copy back isn't overwriting something that was done upstream ] 7) proceed
I did something like a hard checkout to make the Git complaints go away. I filed this bug so whoemever changed the copy-db locally still has the changes. Anyway, thanks for the info... next time I can do the proper thing :)
(In reply to comment #2) > I did something like a hard checkout to make the Git complaints go away. I > filed this bug so whoemever changed the copy-db locally still has the changes. > > Anyway, thanks for the info... next time I can do the proper thing :) Unless there is something I don't understand about Git, "whomever" is you. In any case, the code snippet doesn't match the current code, and I'm uncertain if the autocreate is a good idea or a bad idea so I'm just going to close this.